Files
rust/tests/ui/attributes
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-14 18:18:42 +02:00
2025-05-03 17:22:52 +02:00
2025-08-14 18:18:42 +02:00
2025-05-12 16:35:09 +02:00
2024-08-16 09:07:55 +10:00
2025-08-14 18:18:42 +02:00
2025-08-14 18:18:42 +02:00
2025-06-08 11:25:09 +05:00
2025-02-25 18:17:32 +01:00
2025-02-25 18:17:32 +01:00
2025-02-25 18:17:32 +01:00
2025-02-25 18:17:32 +01:00
2025-08-14 18:18:42 +02:00
2025-08-14 18:18:42 +02:00
2025-06-20 15:06:29 +02:00
2025-06-28 16:24:17 +05:00
2025-06-29 15:37:33 +05:00
2025-06-18 12:37:08 +02:00
2025-06-18 12:37:08 +02:00
2025-01-07 16:04:14 +01:00
2025-08-14 18:18:42 +02:00
2025-08-14 18:18:42 +02:00
2025-08-14 18:18:42 +02:00
2025-08-14 18:18:42 +02:00
2025-08-14 18:18:42 +02:00
2025-08-14 18:18:42 +02:00
2025-08-14 18:18:42 +02:00
2025-08-14 18:18:42 +02:00
2025-08-19 09:03:54 +02:00
2025-08-14 18:18:42 +02:00