Closed
Description
The following code:
struct Foo {
x: &'a u8,
}
Generates this error:
error[E0261]: use of undeclared lifetime name `'a`
--> src/main.rs:2:9
|
2 | x: &'a u8,
| ^^ undeclared lifetime
error: aborting due to previous error
error: Could not compile `playground`.
To learn more, run the command again with --verbose.
It'd be nice to provide a suggestion to add a lifetime parameter to the struct definition.