rust-lang / rust-lang/rustfmt

False negative with `error_on_line_overflow` in Clippy source file

Open
#5,700 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-macros E-help-wanted I-max-width UO-error_on_line_overflow
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
2d 13h
Merged PRs (30d)
24

Description

The issue concerns this line:
https://github.com/rust-lang/rust-clippy/blob/98c4a49db8c305c468646715b773fa9b6ec7049a/clippy_lints/src/derive.rs#L350

The line is 130 characters long, which exceeds the max_width declared in the rustfmt.toml file:
https://github.com/rust-lang/rust-clippy/blob/98c4a49db8c305c468646715b773fa9b6ec7049a/rustfmt.toml#L1

Yet none of these commands produce a change or error:

cargo fmt
rustfmt clippy_lints/src/derive.rs
cargo +nightly fmt
rustfmt +nightly clippy_lints/src/derive.rs

(Re +nightly, recall Clippy uses a rust-toolchain file.)

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 running the listed cargo fmt and rustfmt commands against clippy_lints/src/derive.rs, using the max_width setting in rustfmt.toml and the toolchain specified by rust-toolchain. Compare the result for the referenced line with the reported 130-character length; done means the overflow is either formatted or reported consistently with error_on_line_overflow.

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
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.