E0106: field lifetimes

I've added an example for custom type lifetimes located in another `struct` fields.
This commit is contained in:
Anthony Defranceschi 2017-08-16 22:49:18 +02:00
parent 00a6797f05
commit fe06b70b2a

View File

@ -362,6 +362,10 @@ Here are some simple examples of where you'll run into this error:
struct Foo { x: &bool } // error
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> { A(u8), B(&'a bool), } // correct