Skip to content

Commit f5505d1

Browse files
committed
Add tests for underscore lifetimes in impl headers and struct definitions
1 parent 06926b6 commit f5505d1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/test/compile-fail/underscore-lifetime-binders.rs

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
#![feature(underscore_lifetimes)]
1212

1313
struct Foo<'a>(&'a u8);
14+
struct Baz<'a>(&'_ &'a u8); //~ ERROR missing lifetime specifier
15+
16+
impl Foo<'_> { //~ ERROR missing lifetime specifier
17+
fn x() {}
18+
}
1419

1520
fn foo<'_> //~ ERROR invalid lifetime parameter name: `'_`
1621
(_: Foo<'_>) {}

0 commit comments

Comments
 (0)