You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to run the roman numeral compiler plugin code in the documentation (here). The compiler panics with this error:
thread 'rustc' panicked at 'cannot access a scoped thread local variable without calling `set` first', /Users/vsts/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:168:9
I run cargo build from the root of that repo. I expect the code to compile without errors.
Instead, the compiler panics like this:
$ cargo build
Compiling roman-test v0.1.0 (/Users/mwg/code/rust-macros-roman-numerals/roman-test)
thread 'rustc' panicked at 'cannot access a scoped thread local variable without calling `set` first', /Users/vsts/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:168:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.38.0-nightly (b0e40bfba 2019-08-02) running on x86_64-apple-darwin
note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin
note: some of the compiler flags provided by cargo are hidden
error: Could not compile `roman-test`.
To learn more, run the command again with --verbose.
The problem can be solved by linking to rustc_driver (extern crate rustc_driver;) from the crate that defines the plugin. #62727 is currently trying to make sure that rustc_driver is always linked.
Note that #[plugin] in general is deprecated, and the preferred way to solve problems like implementing roman numerals is using stable proc_macro interface.
Description of Problem
I'm trying to run the roman numeral compiler plugin code in the documentation (here). The compiler panics with this error:
Code to Reproduce
My code is in this repo: github.com/mgoelzer/rust-macros-roman
Expected vs Actual Behavior
I run
cargo build
from the root of that repo. I expect the code to compile without errors.Instead, the compiler panics like this:
Meta
Backtrace
Related Issues
Searching in Google, another issue with the same error is #53469
#27271 is another user trying to compile the roman numeral example, but his problem is different.
The text was updated successfully, but these errors were encountered: