Skip to content

Commit 42c2edf

Browse files
authored
Rollup merge of #140794 - karolzwolak:allow-unused-doc-65464, r=davidtwco
mention lint group in default level lint note ### Summary This PR updates lint diagnostics so that default-level notes now mention the lint group they belong to, if any. Fixes: rust-lang/rust#65464. ### Example ```rust fn main() { let x = 5; } ``` Before: ``` = note: `#[warn(unused_variables)]` on by default ``` After: ``` = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default ``` ### Unchanged Cases Messages remain the same when the lint level is explicitly set, e.g.: * Attribute on the lint `#[warn(unused_variables)]`: ``` note: the lint level is defined here LL | #[warn(unused_variables)] | ^^^^^^^^^^^^^^^^ ``` * Attribute on the group `#[warn(unused)]:`: ``` = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]` ``` * CLI option `-W unused`: ``` = note: `-W unused-variables` implied by `-W unused` = help: to override `-W unused` add `#[allow(unused_variables)]` ``` * CLI option `-W unused-variables`: ``` = note: requested on the command line with `-W unused-variables` ```
2 parents ae9468d + a4035b6 commit 42c2edf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/ui/checked_unwrap/simple_conditionals.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ LL | if X.is_some() {
330330
|
331331
= note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/static-mut-references.html>
332332
= note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
333-
= note: `#[deny(static_mut_refs)]` on by default
333+
= note: `#[deny(static_mut_refs)]` (part of `#[deny(rust_2024_compatibility)]`) on by default
334334

335335
error: aborting due to 36 previous errors
336336

0 commit comments

Comments
 (0)