-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Description
This is the tracking issue for the derive_helper_clashes_with_builtin_attr future-compatibility warning and other related errors. The goal of this page is to describe why this change was made and how you can fix code that is affected by it. It also provides a place to ask questions or register a complaint if you feel the change should not be made. For more information on the policy around future-compatibility warnings, see our breaking change policy guidelines.
What is the warning for?
A derive macro's helper attribute has the same name as that of a built-in attribute
Why was this change made?
This attribute cannot be used, even though it is allowed to be specified inside of attributes(..). If you attempt to use it, you will get an error:
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)]
| ^^^^^
Example
#[proc_macro_derive(Trait, attributes(ignore))]
pub fn example(input: TokenStream) -> TokenStream {
TokenStream::new()
}Recommendations
Remove the helper attribute from attributes(..), or pick another name
When will this warning become a hard error?
Unknown
Steps
- Implement the lint
- Raise lint level to deny
- Change the lint to report in dependencies
- Switch to a hard error