Add warn-by-default lint for visibility on const _ declarations

Add a warn-by-default `unused_visibility` lint for visibility qualifiers
on `const _` declarations - e.g. `pub const _: () = ();`.
These have no effect.
This commit is contained in:
Jules Bertholet 2025-09-28 18:12:17 -04:00
parent f81cf11958
commit 8cc9c5ebb1
2 changed files with 4 additions and 4 deletions

View file

@ -71,10 +71,10 @@ LL | impl<T: core::cmp::Eq> core::fmt::Display for X<T>
| ^^^^^^^^^^^^^^^^^^
error: consider bringing this path into scope with the `use` keyword
--> tests/ui-toml/absolute_paths/absolute_paths.rs:113:14
--> tests/ui-toml/absolute_paths/absolute_paths.rs:113:10
|
LL | pub const _: crate::S = {
| ^^^^^^^^
LL | const _: crate::S = {
| ^^^^^^^^
error: consider bringing this path into scope with the `use` keyword
--> tests/ui-toml/absolute_paths/absolute_paths.rs:114:9

View file

@ -110,7 +110,7 @@ mod m1 {
}
//~[no_short]v absolute_paths
pub const _: crate::S = {
const _: crate::S = {
let crate::S = m1::S; //~[no_short] absolute_paths
crate::m1::S