From f5505d185ccb9b1d84e6d7cdab20f901a778a86c Mon Sep 17 00:00:00 2001 From: Taylor Cramer Date: Wed, 20 Sep 2017 16:06:08 -0700 Subject: [PATCH] Add tests for underscore lifetimes in impl headers and struct definitions --- src/test/compile-fail/underscore-lifetime-binders.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/test/compile-fail/underscore-lifetime-binders.rs b/src/test/compile-fail/underscore-lifetime-binders.rs index 57cabc81778eb..99b6e036f33ea 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<'_>) {}