rust-lang / rust-lang/rust-analyzer
macros 2.0 hygiene is not implemented
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.4.2822-standalone (e0269ce3f2 2026-03-10)
rustc version: rustc 1.96.0-nightly (e370b60cf 2026-03-07)
editor or extension: VS Code 1.112.0; rust-analyzer extension 0.4.2822;
relevant settings: N/A
code snippet to reproduce:
crate a, src/lib.rs:
#![feature(decl_macro)]
pub macro inner() {
true
}
pub macro outer() {{
fn __check() -> bool {
inner!()
}
true
}}
crate b, src/main.rs:
use a::outer;
fn main() {
outer!();
}
Expected: No error. cargo +nightly build compiles.
Actual behavior:
expected bool, found ()
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 issue with crate a/src/lib.rs and crate b/src/main.rs using the shown macro definitions, then run cargo +nightly build for comparison. Trace rust-analyzer's handling of the macro expansion and hygiene; done means the editor reports no type error, matching the successful cargo build.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100