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:
Corey Farwell 2017-08-17 10:44:09 -04:00 committed by GitHub
commit fa7900933f
1 changed files with 4 additions and 0 deletions

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