Add tests for underscore lifetimes in impl headers and struct definitions

This commit is contained in:
Taylor Cramer 2017-09-20 16:06:08 -07:00
parent 06926b6298
commit f5505d185c
1 changed files with 5 additions and 0 deletions

View File

@ -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<'_>) {}