rust-lang / rust-lang/rust

module-level `rustfmt::skip` fails with confusing error

Open
#132,776 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-attributes A-diagnostics A-tool-attributes C-bug D-confusing T-compiler T-lang
Dominant language
Rust
Stars
119k
Forks
16.2k
PR merge metrics
PR metrics pending

Description

https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=73768e89fe43b087349454c8cf2bf2c9

i would have expected / liked to disable rustfmt for the entire module instead of needing to place it on every item.

also, the error seems pretty confusing.

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 by reproducing the linked Rust Playground example with rustfmt and observe the current error for a module-level rustfmt::skip. Then trace the rustfmt handling of the attribute and its diagnostic behavior. Done means the module-level form behaves as requested or produces a clear, actionable error, with regression coverage for the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.