-
Notifications
You must be signed in to change notification settings - Fork 1.7k
$crate
is improperly resolved if it passes through another macro
#6788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
A-macro
macro expansion
C-Architecture
Big architectural things which we need to figure up-front (or suggestions for rewrites :0) )
E-hard
S-actionable
Someone could pick this issue up and work on it right now
Comments
I think |
bors bot
added a commit
that referenced
this issue
Jan 2, 2021
7133: Proper handling $crate and local_inner_macros r=jonas-schievink a=edwin0cheng This PR introduces `HygineFrames` to store the macro definition/call site hierarchy in hyginee and when resolving `local_inner_macros` and `$crate`, we use the token to look up the corresponding frame and return the correct value. See also: https://rustc-dev-guide.rust-lang.org/macro-expansion.html#hygiene-and-hierarchies fixe #6890 and #6788 r? @jonas-schievink Co-authored-by: Edwin Cheng <[email protected]>
Fixed in #7133. |
Fixed in #7145 again :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-macro
macro expansion
C-Architecture
Big architectural things which we need to figure up-front (or suggestions for rewrites :0) )
E-hard
S-actionable
Someone could pick this issue up and work on it right now
Current behavior:
Expected behavior: The macro should be resolved correctly.
This causes incorrect diagnostics in
crates/hir_ty/src/diagnostics/expr.rs
, and probably all places that invoke thepath!
macro.The text was updated successfully, but these errors were encountered: