-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Add warn-by-default lint for visibility on const _ declarations
#147136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
|
rustbot has assigned @jdonszelmann. Use |
This comment has been minimized.
This comment has been minimized.
fc19055 to
3ce40ce
Compare
This comment has been minimized.
This comment has been minimized.
3ce40ce to
32dfd9d
Compare
This comment has been minimized.
This comment has been minimized.
32dfd9d to
4fd61dd
Compare
|
cc: @rust-lang/lang |
|
seems reasonable from me (compiler) then, gotta wait for lang approval |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
@rustbot author |
|
@rustbot ready |
|
One more nit: you now say that there's no declared name to affect which is an explanation sure. But I think for someone to learn what's actually going on it's important to say that specifically assigning to @rustbot author |
|
☔ The latest upstream changes (presumably #149701) made this pull request unmergeable. Please resolve the merge conflicts. |
Add a warn-by-default `unused_visibility` lint for visibility qualifiers on `const _` declarations - e.g. `pub const _: () = ();`. These have no effect.
507cdb6 to
43fa060
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors r+ rollup |
1 similar comment
|
@bors r+ rollup |
1 similar comment
Rollup of 4 pull requests Successful merges: - #147136 (Add warn-by-default lint for visibility on `const _` declarations) - #149498 (Tidying up `tests/ui/issues` tests [1/N]) - #149721 (rustc book: fix `*-pc-windows-msvc` link label in sidebar) - #149724 (Fix off-by-one staging output when testing the library) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #147136 - Jules-Bertholet:const-_-unused-vis, r=jdonszelmann Add warn-by-default lint for visibility on `const _` declarations Add a warn-by-default `unused_visibilities` lint for visibility qualifiers on `const _` declarations—e.g. `pub const _: () = ();`. Such qualifiers have no effect. A [Sourcegraph search](https://sourcegraph.com/search?q=context:global+lang:Rust+pub%5Cs*%28%5C%28.*%5C%29%29%3F%5Cs*const%5Cs%2B_%5Cs*:&patternType=regexp&case=yes&sm=0) suggests that this pattern is relatively rare, and mostly found in tests (with only 3 exceptions). So perhaps this could become an FCW/hard error in the future. `@rustbot` label T-lang A-lints A-visibility -T-clippy
Add a warn-by-default
unused_visibilitieslint for visibility qualifiers onconst _declarations—e.g.pub const _: () = ();. Such qualifiers have no effect.A Sourcegraph search suggests that this pattern is relatively rare, and mostly found in tests (with only 3 exceptions). So perhaps this could become an FCW/hard error in the future.
@rustbot label T-lang A-lints A-visibility -T-clippy