rust-lang / rust-lang/rust-analyzer

"Leftover tokens" error in macro accepted by rustc

Open
#22,203 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

rust-analyzer version: 0.4.2879-standalone (677f2c3cb8 2026-04-27)

rustc version: rustc 1.95.0 (59807616e 2026-04-14)

editor or extension: vscode

relevant settings: none

repository link (if public, optional): https://github.com/Agritite/rust-analyzer-22203-repro

code snippet to reproduce: run pnpm exec napi build if you want to build the module

Image

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 using the linked Agritite/rust-analyzer-22203-repro repository and the mentioned pnpm exec napi build command, comparing rust-analyzer's diagnostic with rustc's acceptance of the macro. No source file or test is named; done means identifying the macro-handling discrepancy and adding coverage that prevents the false "Leftover tokens" error.

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
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.