Files
rust/tests/ui/lint
Jacob Pratt 1e6df58e77 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`
  ```
2025-08-20 00:45:53 -04:00
..
2025-08-10 22:50:14 +09:00
2024-03-14 09:54:42 +08:00
2024-05-15 13:17:11 -05:00
2025-01-07 16:04:14 +01:00
2025-04-20 11:18:38 +02:00
2025-04-06 21:41:47 +02:00
2024-04-22 18:48:47 +02:00
2024-11-16 20:03:31 +00:00
2024-12-09 17:31:16 +08:00
2024-09-23 12:55:56 -04:00
2024-01-05 10:56:59 +00:00
2024-06-25 17:22:22 +02:00
2024-06-25 17:22:22 +02:00
2025-07-13 13:50:00 +00:00
2024-12-24 11:35:38 +08:00