Closed
Description
Formerly:
missing lifetime specifier when none is needed
struct B<T>;
impl B< <'a> ||> {}
$ rustc --crate-type=lib foo.rs
foo.rs:3:9: 3:16 error: missing lifetime specifier
foo.rs:3 impl B< <'a> ||> {}
^~~~~~~
error: aborting due to previous error
The type parameter should be a self-contained type, I'm not sure why it's asking for a lifetime specifier.
New description
The error message above seems to be contradictory, since the <'a>
thing is a lifetime itself, however, the problem is the environment of the closure needs a lifetime, which is written like ||:'a
. It would be nice for the error message to guide people towards the correct thing.