rust-lang / rust-lang/rust-analyzer

Failed to expand macro: a procedural macro error occurred unsupported proc macro punctuation character '['

Open
#18,849 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

rust-analyzer version: 2024-12-30

rustc version: rustc 1.82.0 (f6e511eec 2024-10-15)

editor or extension: VSCode 1.96

relevant settings: All to standard

repository link (if public, optional): https://github.com/ProbablyClem/utoipauto

code snippet to reproduce:

#[utoipauto]
#[derive(Debug, OpenApi)]
#[openapi(info(title = "Generic Test Api"))]
pub(crate) struct ApiDoc;

Rust analyzer thinks that some punctuation error was made but there isn't one.
cargo build finishes without normally.
The issue is the utoipauto macro but I do not know why this is happening.

Here is the issue for the utoipauto repository:
https://github.com/ProbablyClem/utoipauto/issues/46

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

Start with the Rust snippet and the referenced utoipauto repository, then compare rust-analyzer's diagnostic with the result from cargo build. Check the linked utoipauto issue for additional context; done means the valid procedural macro no longer produces the unsupported '[' punctuation error, or the issue is narrowed to a documented incompatibility.

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
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.