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-07-31 14:19:27 +02:00