-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
global_asm!
proc macro is not resolved
#9687
Comments
What Rust version are you using? This works fine for me. Can you provide the full source code needed to reproduce this? |
rustc 1.55.0-nightly (67b03007c 2021-07-23) That is interesting because it has been broken for me since I have been working on this project about 6 months ago, across different computers. I wonder if it has something to do with my project setup. The repo is https://github.com/budde25/os, the relevant code is in lib.rs. |
I am experiencing the same bug. rustc version: For me it has recently broken after the proc macro bug is fixed. |
Bisected the issue to rust-lang/rust#87227 (included since |
Repro: //- /lib.rs crate:lib deps:std
global_asm!();
//- /std.rs crate:std
pub mod prelude {
pub mod rust_2018 {
pub macro global_asm() {
pub struct S;
}
}
} This doesn't resolve, because we first check for This issue ties in with existing bugs around macro resolution described in #8828 (comment) |
9700: fix: Remove the legacy macro scoping hack r=matklad a=jonas-schievink This stops prepending `self::` to single-ident macro paths, resolving even legacy-scoped macros using the fixed-point algorithm. This is not correct, but a lot easier than fixing this properly (which involves pushing a new scope for every macro definition and invocation). This allows resolution of macros from the prelude, fixing #9687. Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
fixed by #9700 |
Thank you! |
global_asm! proc macro throws there error that it is an unresolved-macro-call
Error: "unresolved macro
self::global_asm!
rust-analyzer(unresolved-macro-call)"this does compile output of cargo check:
Also not sure if it is relevant but I also have
#![no_std]
The text was updated successfully, but these errors were encountered: