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
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 3:1
10
+
help: to permit non-static references in an `impl Trait` value, you can add an explicit bound for the anonymous lifetime `'_`
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 6:13
24
+
help: to permit non-static references in an `impl Trait` value, you can add an explicit bound for lifetime `'a`
25
25
|
26
26
LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x }
help: to permit non-static references in a trait object value, you can add an explicit bound for the anonymous lifetime #1 defined on the function body at 18:1
118
+
help: to permit non-static references in a trait object value, you can add an explicit bound for the anonymous lifetime `'_`
help: to permit non-static references in a trait object value, you can add an explicit bound for the lifetime `'a` as defined on the function body at 21:14
133
+
help: to permit non-static references in a trait object value, you can add an explicit bound for lifetime `'a`
| ----- ----------------------- ...is required to be `'static` by this...
6
6
| |
7
-
| data with this lifetime...
7
+
| this data with the anonymous lifetime `'_`...
8
8
LL | self.x.iter().map(|a| a.0)
9
9
| ------ ^^^^
10
10
| |
11
11
| ...and is captured here
12
12
|
13
-
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 method body at 6:5
13
+
help: to permit non-static references in an `impl Trait` value, you can add an explicit bound for the anonymous lifetime `'_`
| -------- ----------------------- ...is required to be `'static` by this...
23
23
| |
24
-
| data with this lifetime...
24
+
| this data with lifetime `'a`...
25
25
LL | self.x.iter().map(|a| a.0)
26
26
| ------ ^^^^
27
27
| |
28
28
| ...and is captured here
29
29
|
30
-
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 method body at 10:20
30
+
help: to permit non-static references in an `impl Trait` value, you can add an explicit bound for lifetime `'a`
Copy file name to clipboardExpand all lines: src/test/ui/issues/issue-16922.stderr
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2,14 +2,14 @@ error: cannot infer an appropriate lifetime
2
2
--> $DIR/issue-16922.rs:4:14
3
3
|
4
4
LL | fn foo<T: Any>(value: &T) -> Box<dyn Any> {
5
-
| -- data with this lifetime...
5
+
| -- this data with the anonymous lifetime `'_`...
6
6
LL | Box::new(value) as Box<dyn Any>
7
7
| ---------^^^^^-
8
8
| | |
9
9
| | ...and is captured here
10
10
| ...is required to be `'static` by this...
11
11
|
12
-
help: to permit non-static references in a trait object value, you can add an explicit bound for the anonymous lifetime #1 defined on the function body at 3:1
12
+
help: to permit non-static references in a trait object value, you can add an explicit bound for the anonymous lifetime `'_`
| --------------- this data with the anonymous lifetime `'_`...
6
6
...
7
7
LL | ss.r
8
8
| ^^^^ ...is captured and required to be `'static` here
9
9
|
10
-
help: to permit non-static references in a trait object value, you can add an explicit bound for the anonymous lifetime #2 defined on the function body at 14:1
10
+
help: to permit non-static references in a trait object value, you can add an explicit bound for the anonymous lifetime `'_`
0 commit comments