rust-lang / rust-lang/rust

Tracking Issue for future-incompatibility lint `ambiguous_derive_helpers`

Open
#151,276 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-attributes A-lints A-macros A-proc-macros C-future-incompatibility C-tracking-issue T-compiler T-lang
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

This is the tracking issue for the ambiguous_derive_helpers 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
Implementation history

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test entry point is named in the tracking issue. Start by reviewing implementation history in PR 151152 and the unchecked milestone options; the work is done only when a specific remaining transition, such as raising the lint level or switching to a hard error, is defined and completed.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.