about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-08-17 10:44:09 -0400
committerGitHub <noreply@github.com>2017-08-17 10:44:09 -0400
commitfa7900933fc5488b0653c2932d81a17e5014da41 (patch)
treef60b4cfc94dd95331b670146114f3aa48bf0b748 /src
parent1512e44c17cdc03adb3a8d87a8a06df2e598069c (diff)
parentd6cdefc4e0000bcb3c07bddd26eaa144bcf5a00b (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/librustc/diagnostics.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs
index 522c1531c59..34d31028385 100644
--- a/src/librustc/diagnostics.rs
+++ b/src/librustc/diagnostics.rs
@@ -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