mirror of https://github.com/rust-lang/rust.git
Rollup merge of #43912 - Songbird0:e0106_field_lifetimes, r=GuillaumeGomez
E0106: field lifetimes Hi there, I've added an example for custom type lifetimes located in another `struct` field. cc @GuillaumeGomez
This commit is contained in:
commit
fa7900933f
|
@ -362,6 +362,10 @@ Here are some simple examples of where you'll run into this error:
|
||||||
struct Foo { x: &bool } // error
|
struct Foo { x: &bool } // error
|
||||||
struct Foo<'a> { x: &'a bool } // correct
|
struct Foo<'a> { x: &'a bool } // correct
|
||||||
|
|
||||||
|
struct Bar { x: Foo }
|
||||||
|
^^^ expected lifetime parameter
|
||||||
|
struct Bar<'a> { x: Foo<'a> } // correct
|
||||||
|
|
||||||
enum Bar { A(u8), B(&bool), } // error
|
enum Bar { A(u8), B(&bool), } // error
|
||||||
enum Bar<'a> { A(u8), B(&'a bool), } // correct
|
enum Bar<'a> { A(u8), B(&'a bool), } // correct
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue