Closed
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_underscore
lint as warn-by-default - Make sufficiently old or low-impact compatibility lints deny-by-default #36894 makes the
lifetime_underscore
lint deny-by-default - Turn sufficiently old compatibility lints into hard errors #42136 makes the
lifetime_underscore
lint a hard error