The following code compiles, even though it would emit an error about the lifetime being unused in any other context:
Interestingly enough,
type Huh<'a> = String;
struct MyStruct<'a> {
foo: Huh<'a>,
}
fails to compile with
error[E0392]: parameter `'a` is never used
--> src/lib.rs:3:17
|
3 | struct MyStruct<'a> {
| ^^ unused parameter
|
= help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
I'm not sure what exactly is going on here, but if nothing else, this error message seems pretty confusing.
context: link
The following code compiles, even though it would emit an error about the lifetime being unused in any other context:
Interestingly enough,
fails to compile with
I'm not sure what exactly is going on here, but if nothing else, this error message seems pretty confusing.
context: link