]> git.lizzy.rs Git - rust.git/blob - src/test/ui/underscore-lifetime/underscore-lifetime-binders.rs
Rollup merge of #57107 - mjbshaw:thread_local_test, r=nikomatsakis
[rust.git] / src / test / ui / underscore-lifetime / underscore-lifetime-binders.rs
1 struct Foo<'a>(&'a u8);
2 struct Baz<'a>(&'_ &'a u8); //~ ERROR missing lifetime specifier
3
4 fn foo<'_> //~ ERROR cannot be used here
5 (_: Foo<'_>) {}
6
7 trait Meh<'a> {}
8 impl<'a> Meh<'a> for u8 {}
9
10 fn meh() -> Box<for<'_> Meh<'_>> //~ ERROR cannot be used here
11 //~^ ERROR missing lifetime specifier
12 {
13   Box::new(5u8)
14 }
15
16 fn foo2(_: &'_ u8, y: &'_ u8) -> &'_ u8 { y } //~ ERROR missing lifetime specifier
17
18 fn main() {
19     let x = 5;
20     foo(Foo(&x));
21     let _ = meh();
22 }