Files
rust/tests/ui/attributes
Jacob Pratt 2dba56033e Rollup merge of #151152 - nik-contrib:helper_attr_builtin, r=chenyukang
Add FCW for derive helper attributes that will conflict with built-in attributes

Adds a future-compatibility-warning deny-by-default lint that helps catch invalid derive helper attribute names early.

This issues the lint, saying that `ignore` helper will clash with the built-in `ignore` attribute.

```rust
#![crate_type = "proc-macro"]
#![deny(ambiguous_derive_helpers)]
use proc_macro::TokenStream;

#[proc_macro_derive(Trait, attributes(ignore))]
pub fn example(input: TokenStream) -> TokenStream {
    TokenStream::new()
}
```

If you actually tried to use that `ignore` helper attribute, you won't be able to due to the ambiguity:

```rust
#[derive(Trait)]
struct Foo {
    #[ignore]
    field: (),
}
```

Produces:

```
error[E0659]: `ignore` is ambiguous
 --> src/lib.rs:5:7
  |
5 |     #[ignore]
  |       ^^^^^^ ambiguous name
  |
  = note: ambiguous because of a name conflict with a builtin attribute
  = note: `ignore` could refer to a built-in attribute
note: `ignore` could also refer to the derive helper attribute defined here
 --> src/lib.rs:3:10
  |
3 | #[derive(Trait)]
  |          ^^^^^
```
2026-02-12 00:41:06 -05:00
..
2025-05-03 17:22:52 +02:00
2025-08-14 18:18:42 +02:00
2025-12-10 23:41:19 +00:00
2025-05-12 16:35:09 +02:00
2024-08-16 09:07:55 +10:00
2023-01-11 09:32:08 +00:00
2025-08-14 18:18:42 +02:00
2025-08-14 18:18:42 +02:00
2026-01-11 10:54:45 +01:00
2025-06-08 11:25:09 +05:00
2026-01-18 22:41:00 +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-06-20 15:06:29 +02:00
2025-12-10 12:28:05 +01: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
2023-01-11 09:32:08 +00:00
2025-12-10 12:28:05 +01:00
2025-12-10 12:28:05 +01:00
2025-01-07 16:04:14 +01:00
2025-12-10 12:28:05 +01:00
2025-08-14 18:18:42 +02:00
2023-01-11 09:32:08 +00:00
2026-01-18 22:41:00 +01:00
2025-08-14 18:18:42 +02:00
2025-08-14 18:18:42 +02:00
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00: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
2023-01-11 09:32:08 +00:00
2023-01-11 09:32:08 +00:00