1
1
error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
2
- --> $DIR/must_outlive_least_region_or_bound.rs:3 :35
2
+ --> $DIR/must_outlive_least_region_or_bound.rs:7 :35
3
3
|
4
4
LL | fn elided(x: &i32) -> impl Copy { x }
5
5
| ---- ^
@@ -12,7 +12,7 @@ LL | fn elided(x: &i32) -> impl Copy + '_ { x }
12
12
| ++++
13
13
14
14
error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
15
- --> $DIR/must_outlive_least_region_or_bound.rs:6 :44
15
+ --> $DIR/must_outlive_least_region_or_bound.rs:10 :44
16
16
|
17
17
LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x }
18
18
| -- ^
@@ -25,15 +25,15 @@ LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x }
25
25
| ++++
26
26
27
27
error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
28
- --> $DIR/must_outlive_least_region_or_bound.rs:9 :46
28
+ --> $DIR/must_outlive_least_region_or_bound.rs:13 :46
29
29
|
30
30
LL | fn elided2(x: &i32) -> impl Copy + 'static { x }
31
31
| ---- ^ ...is used here...
32
32
| |
33
33
| this data with an anonymous lifetime `'_`...
34
34
|
35
35
note: ...and is required to live as long as `'static` here
36
- --> $DIR/must_outlive_least_region_or_bound.rs:9 :24
36
+ --> $DIR/must_outlive_least_region_or_bound.rs:13 :24
37
37
|
38
38
LL | fn elided2(x: &i32) -> impl Copy + 'static { x }
39
39
| ^^^^^^^^^^^^^^^^^^^
@@ -47,15 +47,15 @@ LL | fn elided2(x: &'static i32) -> impl Copy + 'static { x }
47
47
| ~~~~~~~~~~~~
48
48
49
49
error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
50
- --> $DIR/must_outlive_least_region_or_bound.rs:11 :55
50
+ --> $DIR/must_outlive_least_region_or_bound.rs:17 :55
51
51
|
52
52
LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x }
53
53
| ------- ^ ...is used here...
54
54
| |
55
55
| this data with lifetime `'a`...
56
56
|
57
57
note: ...and is required to live as long as `'static` here
58
- --> $DIR/must_outlive_least_region_or_bound.rs:11 :33
58
+ --> $DIR/must_outlive_least_region_or_bound.rs:17 :33
59
59
|
60
60
LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x }
61
61
| ^^^^^^^^^^^^^^^^^^^
@@ -69,15 +69,15 @@ LL | fn explicit2<'a>(x: &'static i32) -> impl Copy + 'static { x }
69
69
| ~~~~~~~~~~~~
70
70
71
71
error[E0621]: explicit lifetime required in the type of `x`
72
- --> $DIR/must_outlive_least_region_or_bound.rs:13 :24
72
+ --> $DIR/must_outlive_least_region_or_bound.rs:21 :24
73
73
|
74
74
LL | fn foo<'a>(x: &i32) -> impl Copy + 'a { x }
75
75
| ---- ^^^^^^^^^^^^^^ lifetime `'a` required
76
76
| |
77
77
| help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
78
78
79
79
error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
80
- --> $DIR/must_outlive_least_region_or_bound.rs:24 :65
80
+ --> $DIR/must_outlive_least_region_or_bound.rs:36 :65
81
81
|
82
82
LL | fn elided5(x: &i32) -> (Box<dyn Debug>, impl Debug) { (Box::new(x), x) }
83
83
| ---- this data with an anonymous lifetime `'_`... ^ ...is used and required to live as long as `'static` here
@@ -92,13 +92,13 @@ LL | fn elided5(x: &i32) -> (Box<dyn Debug>, impl Debug + '_) { (Box::new(x), x)
92
92
| ++++
93
93
94
94
error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
95
- --> $DIR/must_outlive_least_region_or_bound.rs:29 :69
95
+ --> $DIR/must_outlive_least_region_or_bound.rs:43 :69
96
96
|
97
97
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x }
98
98
| ------- this data with lifetime `'a`... ^ ...is used here...
99
99
|
100
100
note: ...and is required to live as long as `'static` here
101
- --> $DIR/must_outlive_least_region_or_bound.rs:29 :34
101
+ --> $DIR/must_outlive_least_region_or_bound.rs:43 :34
102
102
|
103
103
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x }
104
104
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -112,10 +112,10 @@ LL | fn with_bound<'a>(x: &'static i32) -> impl LifetimeTrait<'a> + 'static { x
112
112
| ~~~~~~~~~~~~
113
113
114
114
error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
115
- --> $DIR/must_outlive_least_region_or_bound.rs:34 :5
115
+ --> $DIR/must_outlive_least_region_or_bound.rs:50 :5
116
116
|
117
117
LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) {
118
- | -- hidden type `[closure@$DIR/must_outlive_least_region_or_bound.rs:34 :5: 34 :31]` captures the lifetime `'b` as defined here
118
+ | -- hidden type `[closure@$DIR/must_outlive_least_region_or_bound.rs:50 :5: 50 :31]` captures the lifetime `'b` as defined here
119
119
LL | move |_| println!("{}", y)
120
120
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
121
121
|
@@ -125,7 +125,7 @@ LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32
125
125
| ++++
126
126
127
127
error[E0310]: the parameter type `T` may not live long enough
128
- --> $DIR/must_outlive_least_region_or_bound.rs:38 :51
128
+ --> $DIR/must_outlive_least_region_or_bound.rs:54 :51
129
129
|
130
130
LL | fn ty_param_wont_outlive_static<T:Debug>(x: T) -> impl Debug + 'static {
131
131
| ^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
@@ -136,15 +136,15 @@ LL | fn ty_param_wont_outlive_static<T:Debug + 'static>(x: T) -> impl Debug + 's
136
136
| +++++++++
137
137
138
138
error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
139
- --> $DIR/must_outlive_least_region_or_bound.rs:16 :50
139
+ --> $DIR/must_outlive_least_region_or_bound.rs:24 :50
140
140
|
141
141
LL | fn elided3(x: &i32) -> Box<dyn Debug> { Box::new(x) }
142
142
| ---- ^ ...is used and required to live as long as `'static` here
143
143
| |
144
144
| this data with an anonymous lifetime `'_`...
145
145
|
146
146
note: `'static` lifetime requirement introduced by the return type
147
- --> $DIR/must_outlive_least_region_or_bound.rs:16 :28
147
+ --> $DIR/must_outlive_least_region_or_bound.rs:24 :28
148
148
|
149
149
LL | fn elided3(x: &i32) -> Box<dyn Debug> { Box::new(x) }
150
150
| ^^^^^^^^^ ----------- because of this returned expression
@@ -156,15 +156,15 @@ LL | fn elided3(x: &i32) -> Box<dyn Debug + '_> { Box::new(x) }
156
156
| ++++
157
157
158
158
error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
159
- --> $DIR/must_outlive_least_region_or_bound.rs:18 :59
159
+ --> $DIR/must_outlive_least_region_or_bound.rs:27 :59
160
160
|
161
161
LL | fn explicit3<'a>(x: &'a i32) -> Box<dyn Debug> { Box::new(x) }
162
162
| ------- ^ ...is used and required to live as long as `'static` here
163
163
| |
164
164
| this data with lifetime `'a`...
165
165
|
166
166
note: `'static` lifetime requirement introduced by the return type
167
- --> $DIR/must_outlive_least_region_or_bound.rs:18 :37
167
+ --> $DIR/must_outlive_least_region_or_bound.rs:27 :37
168
168
|
169
169
LL | fn explicit3<'a>(x: &'a i32) -> Box<dyn Debug> { Box::new(x) }
170
170
| ^^^^^^^^^ ----------- because of this returned expression
@@ -176,15 +176,15 @@ LL | fn explicit3<'a>(x: &'a i32) -> Box<dyn Debug + 'a> { Box::new(x) }
176
176
| ++++
177
177
178
178
error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
179
- --> $DIR/must_outlive_least_region_or_bound.rs:20 :60
179
+ --> $DIR/must_outlive_least_region_or_bound.rs:30 :60
180
180
|
181
181
LL | fn elided4(x: &i32) -> Box<dyn Debug + 'static> { Box::new(x) }
182
182
| ---- ^ ...is used and required to live as long as `'static` here
183
183
| |
184
184
| this data with an anonymous lifetime `'_`...
185
185
|
186
186
note: `'static` lifetime requirement introduced by the return type
187
- --> $DIR/must_outlive_least_region_or_bound.rs:20 :40
187
+ --> $DIR/must_outlive_least_region_or_bound.rs:30 :40
188
188
|
189
189
LL | fn elided4(x: &i32) -> Box<dyn Debug + 'static> { Box::new(x) }
190
190
| ^^^^^^^ ----------- because of this returned expression
@@ -200,13 +200,13 @@ LL | fn elided4(x: &'static i32) -> Box<dyn Debug + 'static> { Box::new(x) }
200
200
| ~~~~~~~~~~~~
201
201
202
202
error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
203
- --> $DIR/must_outlive_least_region_or_bound.rs:22 :69
203
+ --> $DIR/must_outlive_least_region_or_bound.rs:33 :69
204
204
|
205
205
LL | fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'static> { Box::new(x) }
206
206
| ------- this data with lifetime `'a`... ^ ...is used and required to live as long as `'static` here
207
207
|
208
208
note: `'static` lifetime requirement introduced by the return type
209
- --> $DIR/must_outlive_least_region_or_bound.rs:22 :49
209
+ --> $DIR/must_outlive_least_region_or_bound.rs:33 :49
210
210
|
211
211
LL | fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'static> { Box::new(x) }
212
212
| ^^^^^^^ ----------- because of this returned expression
0 commit comments