Skip to content
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

Macro panics in rust-analyzer but doesn't panic in cargo build #19487

Open
tamaro-skaljic opened this issue Mar 31, 2025 · 0 comments
Open

Macro panics in rust-analyzer but doesn't panic in cargo build #19487

tamaro-skaljic opened this issue Mar 31, 2025 · 0 comments
Labels
C-bug Category: bug

Comments

@tamaro-skaljic
Copy link

rust-analyzer version: rust-analyzer version: 0.3.2362-standalone (fb133c8 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

Image

rust analyzer in VS Code displays proc-macro panicked

Image

If lib_derive/src/lib.rs#L38 is replaced with panic!("{}", ident);

Image

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.

@tamaro-skaljic tamaro-skaljic added the C-bug Category: bug label Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

1 participant