-
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
Regression(?): proc macro not expanded since v0.3.1091 #12525
Comments
You will need to update rustc. Between the rustc version you are using and the latest one there has been an abi breaking change in the proc_macro implementation. Rust-analyzer 0.3.1091 updated for the new abi and thus broke support for the old abi (on nightly rustc at least) Rust-analyzer doesn't attempt to support nightlies other than the latest. |
There was a change affecting 1.63 nightlies, but it shouldn't have any effect on 1.61. |
This comment was marked as resolved.
This comment was marked as resolved.
The latest release upgraded the diagnostic to warning from weak-lint since we now properly detect whether proc-macros are disabled or not. So these errors might not be new for your project, they are just more visible now. This usually indicates some other build problem for r-a in your project. The easy way out is to disable the specific diagnostic via the settings, though that might give you a worse experience overall for other IDE features still. There might be some information in the server logs as to what is going wrong. Browsing the near-sdk repo works fine for me, the few uses of some proc-macros expand properly. |
Same problem here but with yew macros. Versions as above: rust-analyzer version: 0.3.1091 ra shows an error unresolved-proc-macro for yew's |
Will clarify a bit. In my case (NEAR SDK) the error appears only for attribute macroses and derive macroses:
Some of them are from this crate: https://docs.rs/borsh/latest/borsh. Log (Extension Host) doesn't show any errors. EDIT: "Rust Analyzer Language Server" and "Rust Analyzer Language Server Trace" log channels are empty. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
The borsh and yew macros work fine for me on rustc 1.61 with latest r-a. For anyone having errors here, please check your As a reminder, if you get errors now but didn't onl last r-a it is almost certainly because the weak-lint warning got upgraded, so they were erroring for you before they were just barely visible. |
And for those that either do not want to investigate why their proc-macro's don't get resolved by r-a, or want to get around this since they want to work before investigating it, you can set |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I'll hide the resolved comments here so we don't lose track of the different people here, @sumerman if you can't seem to figure out your new problem feel free top open a new issue for that. |
This comment was marked as resolved.
This comment was marked as resolved.
@andrew-sol @arnolddevos Please try the current pre-release version; it should show a more detailed error message. |
Heads up, #12584 fixed an issue where we potentially did misdiagnose derive helpers as being unresolved specifically. Please let us know if your issues were due to derive helpers erroring or not (so we know whose issues may have been fixed by that here). |
Updated to the pre-release version. Now the error says (paths are shortened):
I'm on Apple M1. |
CC @cloutiertyler via #10894. @andrew-sol what do you get in Code / Help / About, and did you set |
VSCode's "about" shows this:
I didn't change any rust-analyzer settings, so |
@andrew-sol what about |
That incompatible arch problem has popped up for a few mac users it seems, see #12494 (comment) Given the comment that is probably something we'll have to fix somehow, but I don't know anything about that. |
I switched some time ago back and forth, but not recently. My
|
Yeah, I don't think you want that. |
I think #12579 will fix that problem if/when we implement it. |
Hmm but that's the target architecture, right? Like when I install a wasm toolchain, it compiles to wasm, but runs on x86_64. Can you have a toolchain built for aarch64 that compiles to x86_64, or vice versa? How does rustup choose the host architecture of the toolchain on M1 Macs? 🤔 (What does |
Umm, yes? I think the problem is that @andrew-sol is using the Aarch64 RA with an I'm curious if this is a new install or a cloned drive. And can you use e.g. an x64 Firefox or Chrome to download an x64 |
I did:
removed the The error has gone. When I did this the previous time some project dependencies didn't compile for arch64, but now they do. |
I suppose you need to install the x64 version of Code (or use the x64 RA server) if you want to build your project for x64. |
Right, but what I'm trying to say is that just because rustup says Unless rustup on M1 Mac installs aarch64 builds for compiling to aarch64, and x86 builds for compiling to x86. Which I guess would make some sense.
Or just point |
Yes it would. The triple in the toolchain name is the triple for which the compiler itself is built and is thus the host triple. |
Ah right, I was confusing toolchains with targets 😅 Then I guess it should also be possible to cross-compile to x86_64 with an aarch64 toolchain and aarch64 rust-analyzer build. |
Well, the original issue is clarified, so let's close this ticket. |
Yeah, thanks for your help. |
I use NEAR Rust SDK crate (https://docs.rs/near-sdk/latest/near_sdk).
I see "proc macro not expanded" errors everywhere after the update to v0.3.1091.
v0.3.1083 works fine.
rust-analyzer version: 0.3.1091
rustc version: rustc 1.61.0 (fe5b13d68 2022-05-18)
relevant settings:
CARGO
,RUSTUP_HOME
,RUSTUP_HOME
are emptyThe text was updated successfully, but these errors were encountered: