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
| ---- ------------------- ^ ...and is captured here
34
+
| | |
35
+
| | ...is required to be `'static` by this...
36
+
| data with this lifetime...
37
+
|
38
+
help: to permit non-static references in an `impl Trait` value, you can add an explicit bound for the anonymous lifetime #1 defined on the function body at 9:1
| ------- ------------------- ^ ...and is captured here
48
+
| | |
49
+
| | ...is required to be `'static` by this...
50
+
| data with this lifetime...
51
+
|
52
+
help: to permit non-static references in an `impl Trait` value, you can add an explicit bound for the lifetime `'a` as defined on the function body at 12:14
53
+
|
54
+
LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'a { x }
55
+
| ^^
56
+
57
+
error[E0621]: explicit lifetime required in the type of `x`
| ------- -------------------------------- ^ ...and is captured here
34
70
| | |
35
71
| | ...is required to be `'static` by this...
36
72
| data with this lifetime...
37
73
|
38
-
help: to permit non-static references in an `impl Trait` value, you can add an explicit bound for the lifetime `'a` as defined on the function body at 12:15
74
+
help: to permit non-static references in an `impl Trait` value, you can add an explicit bound for the lifetime `'a` as defined on the function body at 33:15
39
75
|
40
-
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static + 'a { x }
41
-
| ^^^^
76
+
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'a { x }
help: to permit non-static references in a `dyn Trait` value, you can add an explicit bound for the anonymous lifetime #1 defined on the function body at 18:1
help: to permit non-static references in a `dyn Trait` value, you can add an explicit bound for the lifetime `'a` as defined on the function body at 21:14
0 commit comments