Skip to content

"proc macro server crashed" in presence of attribute proc-macros #8906

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

Closed
Shnatsel opened this issue May 21, 2021 · 7 comments
Closed

"proc macro server crashed" in presence of attribute proc-macros #8906

Shnatsel opened this issue May 21, 2021 · 7 comments

Comments

@Shnatsel
Copy link
Member

I am aware of #6029, but I'd expect unsupported attribute macros to be ignored, not to crash RA.

rust-analyzer version: b82458818 2021-05-17 stable

Panic messages from RA output in VSCode: https://gist.github.com/Shnatsel/f71fa1f070c6547cb282a3ee76c211c0
They are quite spectacular, there's a panic while panicking.

Steps to reproduce: open https://github.com/RustSec/rustsec/tree/main/admin directory in VSCode and navigate to commands.rs

@lnicola
Copy link
Member

lnicola commented May 21, 2021

That's a proc macro ABI incompatibility with the old version in your rust-toolchain. The metadata is versioned, but it seems that the format changed at some point without bumping the version. Regardless of that, we only support the last stable proc macro ABI.

@Shnatsel
Copy link
Member Author

Is there a FAQ entry on how to resolve this?

Rust version for reference:

> rustc --version --verbose 
rustc 1.52.1 (9bc8c42bb 2021-05-09)
binary: rustc
commit-hash: 9bc8c42bb2f19e745a63f3445f1ac248fb015e53
commit-date: 2021-05-09
host: x86_64-unknown-linux-gnu
release: 1.52.1
LLVM version: 12.0.0

@lnicola
Copy link
Member

lnicola commented May 21, 2021

You can either:

  • disable proc macro support
  • remove the rust-toolchain file
  • wait for multiple proc ABI support to be added to RA (to say the least, that's unlikely to be a priority)

@lnicola
Copy link
Member

lnicola commented May 21, 2021

rustc 1.52.1 (9bc8c42bb 2021-05-09)

What does rustup toolchain list show?

@Shnatsel
Copy link
Member Author

Ah I see, it must be the toolchain file that's causing this.

> rustup toolchain list
stable-x86_64-unknown-linux-gnu (default)
beta-x86_64-unknown-linux-gnu
nightly-2018-10-12-x86_64-unknown-linux-gnu
nightly-2019-04-12-x86_64-unknown-linux-gnu
nightly-2019-05-22-x86_64-unknown-linux-gnu
nightly-2019-10-17-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu
1.24.1-x86_64-unknown-linux-gnu
1.32.0-x86_64-unknown-linux-gnu
1.39.0-x86_64-unknown-linux-gnu
1.42.0-x86_64-unknown-linux-gnu
1.46.0-x86_64-unknown-linux-gnu (override)

@lnicola
Copy link
Member

lnicola commented May 21, 2021

Yes, your project's rust-toolchain file asks for 1.46. It's the same issue as #8148 (comment).

@Shnatsel
Copy link
Member Author

I see, I'll close it in favor of that issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants