From fe06b70b2a2794df6f976f0d20b27f154a633fca Mon Sep 17 00:00:00 2001 From: Anthony Defranceschi Date: Wed, 16 Aug 2017 22:49:18 +0200 Subject: [PATCH] E0106: field lifetimes I've added an example for custom type lifetimes located in another `struct` fields. --- src/librustc/diagnostics.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs index 522c1531c59..48f2d0b3198 100644 --- a/src/librustc/diagnostics.rs +++ b/src/librustc/diagnostics.rs @@ -362,6 +362,10 @@ enum Enum { 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 -- 2.44.0