rust-lang / rust-lang/rust-analyzer

RA incorrectly denotes an error on an attribute macro where `cargo run` works without error

Open
#15,489 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-diagnostics A-mir C-bug
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

RA incorrectly denotes an error on an attribute macro where cargo run works without error.

Screenshot from 2023-08-20 22-34-42

The code can be run with:

git clone https://github.com/JonathanWoollett-Light/log-instrument
cd log-instrument
git checkout 143de440ed2a3b1398efba8005813728cfc96dd2
cargo run --example three

Opening the log-instrument folder with VSCode with the RA extension enabled should highlight the attribute macro with this error incorrectly.

rust-analyzer version: rust-analyzer version: 0.3.1623-standalone

rustc version: rustc 1.73.0-nightly (6ef7d16be 2023-08-19)

relevant settings: None I'm aware of.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report by cloning log-instrument at commit 143de440ed2a3b1398efba8005813728cfc96dd2 and running cargo run --example three, then open the folder in VSCode with the rust-analyzer extension. Trace the diagnostic shown on the attribute macro and verify that the incorrect error highlight is gone while the example still runs successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.