about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAnthony Defranceschi <chaacygg@gmail.com>2017-08-16 22:49:18 +0200
committerAnthony Defranceschi <chaacygg@gmail.com>2017-08-16 22:49:18 +0200
commitfe06b70b2a2794df6f976f0d20b27f154a633fca (patch)
tree8985beb22d930e369fbddc8cadf754d0c32e939f
parent00a6797f05607ed0d29d25378fb502a8a9b0a6bf (diff)
downloadrust-fe06b70b2a2794df6f976f0d20b27f154a633fca.tar.gz
rust-fe06b70b2a2794df6f976f0d20b27f154a633fca.zip
E0106: field lifetimes
I've added an example for custom type lifetimes located in another `struct` fields.
-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..48f2d0b3198 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