- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.
Description
What is this lint about
Lifetime name '_ is reserved for possible future use as a lifetime placeholder, similarly to how _ is used as a placeholder in types or patterns (see, for example, rust-lang/rfcs#1177).
Earlier versions of the compiler accepted '_ as a normal lifetime or label name, #33794 fixed this oversight.
How to fix this warning/error
Rename the lifetime or label named '_ into something else, like 'a or 'z.
Current status
-  Add AST validation pass and move some checks to it #33794 introduces the lifetime_underscorelint as warn-by-default
-  Make sufficiently old or low-impact compatibility lints deny-by-default #36894 makes the lifetime_underscorelint deny-by-default
-  Turn sufficiently old compatibility lints into hard errors #42136 makes the lifetime_underscorelint a hard error
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.