You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fn foo<'a>(d: impl Sized + 'a, p: &'a mut ()) -> impl Sized + '_ { //~ NOTE the parameter type `impl Sized` must be valid for the anonymous lifetime defined here...
6
+
//~^ HELP consider adding an explicit lifetime bound
7
+
(d, p)
8
+
//~^ ERROR the parameter type `impl Sized` may not live long enough
9
+
//~| NOTE ...so that the type `impl Sized` will meet its required lifetime bounds
//~^ HELP consider adding an explicit lifetime bound...
14
+
(d, p) //~ NOTE ...so that the type `impl Sized` will meet its required lifetime bounds
15
+
//~^ ERROR the parameter type `impl Sized` may not live long enough
16
+
}
17
+
18
+
fn foo2<'b, 'a>(d: impl Sized + 'a + 'b, p: &'b mut ()) -> impl Sized + '_ { //~ NOTE the parameter type `impl Sized + 'a` must be valid for the anonymous lifetime defined here...
19
+
//~^ HELP consider adding an explicit lifetime bound
20
+
(d, p)
21
+
//~^ ERROR the parameter type `impl Sized + 'a` may not live long enough
22
+
//~| NOTE ...so that the type `impl Sized + 'a` will meet its required lifetime bounds
23
+
}
24
+
25
+
fn bar<'a, T : Sized + 'a>(d: T, p: &'a mut ()) -> impl Sized + '_ { //~ NOTE the parameter type `T` must be valid for the anonymous lifetime defined here...
26
+
//~^ HELP consider adding an explicit lifetime bound
27
+
(d, p)
28
+
//~^ ERROR the parameter type `T` may not live long enough
29
+
//~| NOTE ...so that the type `T` will meet its required lifetime bounds
//~^ HELP consider adding an explicit lifetime bound...
34
+
(d, p) //~ NOTE ...so that the type `T` will meet its required lifetime bounds
35
+
//~^ ERROR the parameter type `T` may not live long enough
36
+
}
37
+
38
+
fn bar2<'b, 'a, T : Sized + 'a + 'b>(d: T, p: &'b mut ()) -> impl Sized + '_ { //~ NOTE the parameter type `T` must be valid for the anonymous lifetime defined here...
39
+
//~^ HELP consider adding an explicit lifetime bound
40
+
(d, p)
41
+
//~^ ERROR the parameter type `T` may not live long enough
42
+
//~| NOTE ...so that the type `T` will meet its required lifetime bounds
//~^ HELP consider adding an explicit lifetime bound...
14
+
(d, p)//~ NOTE ...so that the type `impl Sized` will meet its required lifetime bounds
15
+
//~^ ERROR the parameter type `impl Sized` may not live long enough
16
+
}
17
+
18
+
fnfoo2<'a>(d:implSized + 'a,p:&mut()) -> implSized + '_{//~ NOTE the parameter type `impl Sized + 'a` must be valid for the anonymous lifetime defined here...
19
+
//~^ HELP consider adding an explicit lifetime bound
20
+
(d, p)
21
+
//~^ ERROR the parameter type `impl Sized + 'a` may not live long enough
22
+
//~| NOTE ...so that the type `impl Sized + 'a` will meet its required lifetime bounds
23
+
}
24
+
25
+
fnbar<T:Sized>(d:T,p:&mut()) -> implSized + '_{//~ NOTE the parameter type `T` must be valid for the anonymous lifetime defined here...
26
+
//~^ HELP consider adding an explicit lifetime bound
27
+
(d, p)
28
+
//~^ ERROR the parameter type `T` may not live long enough
29
+
//~| NOTE ...so that the type `T` will meet its required lifetime bounds
0 commit comments