Commit b3e0e17
authored
Fix
`cargo clippy --explain <lint>` prints `unknown lint` for every lint on
beta and nightly.
`src/main.rs` lowercases the argument, but `Lint::name` is uppercase
(`clippy::ALLOW_ATTRIBUTES`), so the lookup in `explain` never matches.
The `to_ascii_uppercase` that reconciled the two was dropped in
c97f7eb ("Rewrite of the config parsing code"), and this restores that
line verbatim. `beta` and `master` carry the commit, stable 0.1.98 does
not, which is why `--explain` still works there.
The lowercase rebinding below the lookup is deliberately left alone.
`mdconf.retain(...)` keys on that form, so removing it would silently
drop every configuration section.
The tests are new because `--explain` had no coverage at all, which is
how this went unreported for three weeks.
`cargo test --features internal` passes here apart from the 16
`tests/ui-internal` cases, which fail the same way on an unmodified
master checkout, so they look local to my Windows setup.
#17573 moves this code and inherits the same
mismatch, so whichever lands second needs a small rebase.
fixes #17620
changelog: Fix `cargo clippy --explain <lint>` reporting `unknown lint`
for every lint--explain lint lookup being case-mismatched (#17632)2 files changed
Lines changed: 45 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | | - | |
| 426 | + | |
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
0 commit comments