1 // Test that we check that user type annotations are well-formed, even in dead
6 let x: &'static &'a (); //~ ERROR lifetime may not live long enough
11 let x: &'static &'a () = &&(); //~ ERROR lifetime may not live long enough
14 fn uninit_infer<'a>() {
15 let x: &'static &'a _; //~ ERROR lifetime may not live long enough
21 let x: &'static &'a _ = &&(); //~ ERROR lifetime may not live long enough
24 fn uninit_no_var<'a>() {
26 let _: &'static &'a (); //~ ERROR lifetime may not live long enough
31 let _: &'static &'a () = &&(); //~ ERROR lifetime may not live long enough
34 fn infer_no_var<'a>() {
36 let _: &'static &'a _ = &&(); //~ ERROR lifetime may not live long enough
41 struct C<'a, 'b, T: X<'a, 'b>>(T, &'a (), &'b ());
43 impl X<'_, '_> for i32 {}
44 impl<'a> X<'a, 'a> for () {}
46 // This type annotation is not well-formed because we substitute `()` for `_`.
47 fn required_substs<'a>() {
49 let _: C<'static, 'a, _> = C((), &(), &()); //~ ERROR lifetime may not live long enough