Skip to content

Commit fe06b70

Browse files
committed
E0106: field lifetimes
I've added an example for custom type lifetimes located in another `struct` fields.
1 parent 00a6797 commit fe06b70

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)