rust-lang / rust-lang/rust-analyzer
Wrong macro expansion
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: 0.3.2196-standalone
rustc version: (eg. output of rustc -V)
editor or extension: v0.3.2196
relevant settings: all unset
repository link (if public, optional): rust-enumeration
code snippet to reproduce: I do not know how to make a minimized reproducible example. tests/test.rs reports an error with "cannot define inherent impl on foreign type" and "unexpected token in input" from the macro invocation in line 56~60. However, cargo test runs fine without reporting any error. While attempting to reproduce the issue, you may need to modify the file (e.g. enter a new line and delete it) as the error may not be reported. Attempting to inline macro will result in missing tokens. I do not know if this is only reproducible on my machine.
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
Start with the linked rust-enumeration repository and inspect tests/test.rs, especially the macro invocation around lines 56–60. Reproduce the reported diagnostics in rust-analyzer, compare them with the successful cargo test run, and determine whether editing the file or inlining the macro changes the result. Done means the false errors and missing-token behavior are resolved for this reproduction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100