rust-lang / rust-lang/rust-analyzer
Macro panics in rust-analyzer but doesn't panic in cargo build
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
rust-analyzer version: rust-analyzer version: 0.3.2362-standalone (fb133c8c80 2025-03-29) [c:\Users\Tamaro.vscode\extensions\rust-lang.rust-analyzer-0.3.2362-win32-x64\server\rust-analyzer.exe]
rustc version: rustc 1.85.0 (4d91de4e4 2025-02-17)
editor or extension: VSCode 0.3.2362
repository link: https://github.com/tamaro-skaljic/rustc-vs-rust-analyzer
cd lib-test
cargo build
build successful
rust analyzer in VS Code displays proc-macro panicked
If lib_derive/src/lib.rs#L38 is replaced with panic!("{}", ident);
looks like the macro is executed two times, 1. before the table macro is evaluated, 2. after the table macro is evaluated. At least we can say that rust-analyzer doesn't do the same thing as cargo build.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the discrepancy in the linked rustc-vs-rust-analyzer repository by running cargo build in lib-test and observing the proc-macro result in VS Code. Inspect lib_derive/src/lib.rs around line 38 and compare the macro's behavior before and after the table macro is evaluated; done means explaining or correcting the differing rust-analyzer behavior without breaking the successful Cargo build.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, vscode
- Domain
- compilers, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100