summary refs log tree commit diff
path: root/src/test/compile-fail
diff options
context:
space:
mode:
authorTaylor Cramer <cramertj@google.com>2017-09-20 16:06:08 -0700
committerTaylor Cramer <cramertj@google.com>2017-09-21 10:19:12 -0700
commitf5505d185ccb9b1d84e6d7cdab20f901a778a86c (patch)
tree4def7c3a3228952c88ce5c01152158d68ef9214c /src/test/compile-fail
parent06926b6298693a1fd6ad85073fc38b26cf6d6fbf (diff)
downloadrust-f5505d185ccb9b1d84e6d7cdab20f901a778a86c.tar.gz
rust-f5505d185ccb9b1d84e6d7cdab20f901a778a86c.zip
Add tests for underscore lifetimes in impl headers and struct definitions
Diffstat (limited to 'src/test/compile-fail')
-rw-r--r--src/test/compile-fail/underscore-lifetime-binders.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/compile-fail/underscore-lifetime-binders.rs b/src/test/compile-fail/underscore-lifetime-binders.rs
index 57cabc81778..99b6e036f33 100644
--- a/src/test/compile-fail/underscore-lifetime-binders.rs
+++ b/src/test/compile-fail/underscore-lifetime-binders.rs
@@ -11,6 +11,11 @@
 #![feature(underscore_lifetimes)]
 
 struct Foo<'a>(&'a u8);
+struct Baz<'a>(&'_ &'a u8); //~ ERROR missing lifetime specifier
+
+impl Foo<'_> { //~ ERROR missing lifetime specifier
+    fn x() {}
+}
 
 fn foo<'_> //~ ERROR invalid lifetime parameter name: `'_`
 (_: Foo<'_>) {}