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
jsmith628 opened this issue
Jan 20, 2019
· 1 comment
· Fixed by #57908
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-resolveArea: Name resolutionI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
So I was working on a macro and ran into an rather weird bug regarding imports. It's not really high priority, and I myself found a work around for my specific use case, but here's some info in case it's helpful.
Basically, if you have a macro from another crate that imports something using a macro variable and that thing is already in scope, then rustc will panic.
ie, if you create a crate called "bug_test" with this in src/lib.rs
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-resolveArea: Name resolutionI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
So I was working on a macro and ran into an rather weird bug regarding imports. It's not really high priority, and I myself found a work around for my specific use case, but here's some info in case it's helpful.
Basically, if you have a macro from another crate that imports something using a macro variable and that thing is already in scope, then rustc will panic.
ie, if you create a crate called "bug_test" with this in
src/lib.rs
and this in
src/main.rs
:then running with cargo using
RUST_BACKTRACE=full
and--verbose
will crash with the following output:Some additional information:
:path
doesn't matter. It crashes even when you use:ident
The text was updated successfully, but these errors were encountered: