[beta] Clippy backport - #163264
Merged
Merged
[beta] Clippy backport#163264
Conversation
`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. rust-lang/rust-clippy#17573 moves this code and inherits the same mismatch, so whichever lands second needs a small rebase. fixes rust-lang/rust-clippy#17620 changelog: Fix `cargo clippy --explain <lint>` reporting `unknown lint` for every lint
…g#17752) Implements part of rust-lang/rust-clippy#17485 Unleaking a leaked `Box` pointer isn't well defined, so we shouldn't be suggesting to change `into_raw` into `leak`. This needs to be backported to beta and ideally would be synced before a new beta is branched off. r? flip1995 changelog: [`nonnull_unchecked_on_box_ptr`]: Don't suggest `Box::leak`
Collaborator
|
cc @rust-lang/clippy |
This comment has been minimized.
This comment has been minimized.
This was referenced Sep 24, 2026
This comment has been minimized.
This comment has been minimized.
…r_generic_args` (rust-lang#17731) Did a bit of poking, I think this is the kind of skip that we want. There are a few other options where to skip, but this keeps the "least nessary skip" I think. Fixes rust-lang/rust-clippy#17717 changelog: [`needless_borrows_for_generic_args`]: add `const_trait_impl` compatability (such as for example the destructor of `Vec`) to not send the old solver into an infinite loop Alternatively, I am also opening an PR to move this lint to `nursary` that we can also merge and backport to make sure that stable is not broken. Regarding commits, I currently have not split the commits more (impl from tests), not sure how this backporting works exactly. Given that this affects beta (which we release in 15 days) on an warn-by-default lint, I hope this is ok: r? clippy @rustbot label beta-nominated
flip1995
force-pushed
the
clippy-beta-backport
branch
from
September 24, 2026 14:12
23702c2 to
dcc47f7
Compare
Collaborator
|
Member
|
@bors r+ rollup=never |
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 25, 2026
[beta] Clippy backport r? Mark-Simulacrum Backporting 3 PRs: - rust-lang/rust-clippy#17632 fixes a UX issue where `--explain` stopped working in the current beta - rust-lang/rust-clippy#17752 Fixes a bad suggestion that this lint is currently making on stable -- we'd rather fix this sooner than later - rust-lang/rust-clippy#17731 Fixes an infinite loop
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for 32a17c0 failed: CI. Failed job:
|
Member
|
@bors retry |
This comment has been minimized.
This comment has been minimized.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
r? Mark-Simulacrum
Backporting 3 PRs:
--explainlint lookup being case-mismatched rust-clippy#17632 fixes a UX issue where--explainstopped working in the current betaBox::leakinnonnull_unchecked_on_box_ptrrust-clippy#17752 Fixes a bad suggestion that this lint is currently making on stable -- we'd rather fix this sooner than laterconst_trait_implrelated infinite loop inneedless_borrows_for_generic_argsrust-clippy#17731 Fixes an infinite loop