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
Copy file name to clipboardExpand all lines: tests/ui/suggestions/lifetimes/issue-105544.fixed
+4-4
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
#![allow(warnings)]
4
4
5
-
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...
5
+
fn foo<'a>(d: impl Sized + 'a, p: &'a mut ()) -> impl Sized + 'a { //~ NOTE the parameter type `impl Sized` must be valid for the anonymous lifetime defined here...
6
6
//~^ HELP consider adding an explicit lifetime bound
7
7
(d, p)
8
8
//~^ ERROR the parameter type `impl Sized` may not live long enough
//~^ ERROR the parameter type `impl Sized` may not live long enough
16
16
}
17
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...
18
+
fn foo2<'b, 'a>(d: impl Sized + 'a + 'b, p: &'b mut ()) -> impl Sized + 'b { //~ NOTE the parameter type `impl Sized + 'a` must be valid for the anonymous lifetime defined here...
19
19
//~^ HELP consider adding an explicit lifetime bound
20
20
(d, p)
21
21
//~^ ERROR the parameter type `impl Sized + 'a` may not live long enough
22
22
//~| NOTE ...so that the type `impl Sized + 'a` will meet its required lifetime bounds
23
23
}
24
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...
25
+
fn bar<'a, T : Sized + 'a>(d: T, p: &'a mut ()) -> impl Sized + 'a { //~ NOTE the parameter type `T` must be valid for the anonymous lifetime defined here...
26
26
//~^ HELP consider adding an explicit lifetime bound
27
27
(d, p)
28
28
//~^ ERROR the parameter type `T` may not live long enough
//~^ ERROR the parameter type `T` may not live long enough
36
36
}
37
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...
38
+
fn bar2<'b, 'a, T : Sized + 'a + 'b>(d: T, p: &'b mut ()) -> impl Sized + 'b { //~ NOTE the parameter type `T` must be valid for the anonymous lifetime defined here...
39
39
//~^ HELP consider adding an explicit lifetime bound
40
40
(d, p)
41
41
//~^ ERROR the parameter type `T` may not live long enough
0 commit comments