Files
rust/tests/ui/impl-trait
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-05-09 02:35:18 +00:00
2025-08-08 19:24:53 +02:00
2025-08-08 13:49:27 +02:00
2025-05-02 11:46:31 -07:00
2025-04-03 11:13:10 +02:00
2025-04-03 11:13:10 +02:00
2025-06-30 11:50:19 +05:00
2024-06-13 10:41:52 +00:00
2024-06-13 10:41:52 +00:00
2024-04-08 15:00:03 +00:00
2024-08-17 12:43:25 -04:00
2024-06-19 08:28:31 +00:00
2024-06-19 08:28:31 +00:00
2024-06-19 08:40:29 +00:00