Skip to content

Commit 8cc9c5e

Browse files
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.
1 parent f81cf11 commit 8cc9c5e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/ui-toml/absolute_paths/absolute_paths.no_short.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ LL | impl<T: core::cmp::Eq> core::fmt::Display for X<T>
7171
| ^^^^^^^^^^^^^^^^^^
7272

7373
error: consider bringing this path into scope with the `use` keyword
74-
--> tests/ui-toml/absolute_paths/absolute_paths.rs:113:14
74+
--> tests/ui-toml/absolute_paths/absolute_paths.rs:113:10
7575
|
76-
LL | pub const _: crate::S = {
77-
| ^^^^^^^^
76+
LL | const _: crate::S = {
77+
| ^^^^^^^^
7878

7979
error: consider bringing this path into scope with the `use` keyword
8080
--> tests/ui-toml/absolute_paths/absolute_paths.rs:114:9

tests/ui-toml/absolute_paths/absolute_paths.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ mod m1 {
110110
}
111111

112112
//~[no_short]v absolute_paths
113-
pub const _: crate::S = {
113+
const _: crate::S = {
114114
let crate::S = m1::S; //~[no_short] absolute_paths
115115

116116
crate::m1::S

0 commit comments

Comments
 (0)