Skip to content

Commit fa79009

Browse files
authored
Rollup merge of rust-lang#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
2 parents 1512e44 + d6cdefc commit fa79009

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc/diagnostics.rs

+4
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,10 @@ Here are some simple examples of where you'll run into this error:
362362
struct Foo { x: &bool } // error
363363
struct Foo<'a> { x: &'a bool } // correct
364364
365+
struct Bar { x: Foo }
366+
^^^ expected lifetime parameter
367+
struct Bar<'a> { x: Foo<'a> } // correct
368+
365369
enum Bar { A(u8), B(&bool), } // error
366370
enum Bar<'a> { A(u8), B(&'a bool), } // correct
367371

0 commit comments

Comments
 (0)