Skip to content

Commit 507cdb6

Browse files
Expand lint note
1 parent 641bd12 commit 507cdb6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/rustc_lint/messages.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ lint_unused_op = unused {$op} that must be used
949949
lint_unused_result = unused result of type `{$ty}`
950950
951951
lint_unused_visibilities = visibility qualifiers have no effect on `const _` declarations
952-
.note = there is no declared name for the qualifier to affect
952+
.note = `const _` does not declare a name, so there is nothing for the qualifier to apply to
953953
.suggestion = remove the qualifier
954954
955955
lint_use_let_underscore_ignore_suggestion = use `let _ = ...` to ignore the expression or result

tests/ui/lint/unused-visibilities.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: visibility qualifiers have no effect on `const _` declarations
44
LL | pub const _: () = {};
55
| ^^^ help: remove the qualifier
66
|
7-
= note: there is no declared name for the qualifier to affect
7+
= note: `const _` does not declare a name, so there is nothing for the qualifier to apply to
88
note: the lint level is defined here
99
--> $DIR/unused-visibilities.rs:4:9
1010
|
@@ -17,7 +17,7 @@ warning: visibility qualifiers have no effect on `const _` declarations
1717
LL | pub(self) const _: () = {};
1818
| ^^^^^^^^^ help: remove the qualifier
1919
|
20-
= note: there is no declared name for the qualifier to affect
20+
= note: `const _` does not declare a name, so there is nothing for the qualifier to apply to
2121

2222
warning: visibility qualifiers have no effect on `const _` declarations
2323
--> $DIR/unused-visibilities.rs:14:9
@@ -28,7 +28,7 @@ LL | pub const _: () = {};
2828
LL | foo!();
2929
| ------ in this macro invocation
3030
|
31-
= note: there is no declared name for the qualifier to affect
31+
= note: `const _` does not declare a name, so there is nothing for the qualifier to apply to
3232
= note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
3333

3434
warning: 3 warnings emitted

0 commit comments

Comments
 (0)