11error[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
33 |
44LL | fn elided(x: &i32) -> impl Copy { x }
55 | ---- ^
@@ -12,7 +12,7 @@ LL | fn elided(x: &i32) -> impl Copy + '_ { x }
1212 | ++++
1313
1414error[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
1616 |
1717LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x }
1818 | -- ^
@@ -25,15 +25,15 @@ LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x }
2525 | ++++
2626
2727error[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
2929 |
3030LL | fn elided2(x: &i32) -> impl Copy + 'static { x }
3131 | ---- ^ ...is used here...
3232 | |
3333 | this data with an anonymous lifetime `'_`...
3434 |
3535note: ...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
3737 |
3838LL | fn elided2(x: &i32) -> impl Copy + 'static { x }
3939 | ^^^^^^^^^^^^^^^^^^^
@@ -47,15 +47,15 @@ LL | fn elided2(x: &'static i32) -> impl Copy + 'static { x }
4747 | ~~~~~~~~~~~~
4848
4949error[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
5151 |
5252LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x }
5353 | ------- ^ ...is used here...
5454 | |
5555 | this data with lifetime `'a`...
5656 |
5757note: ...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
5959 |
6060LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x }
6161 | ^^^^^^^^^^^^^^^^^^^
@@ -69,15 +69,15 @@ LL | fn explicit2<'a>(x: &'static i32) -> impl Copy + 'static { x }
6969 | ~~~~~~~~~~~~
7070
7171error[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
7373 |
7474LL | fn foo<'a>(x: &i32) -> impl Copy + 'a { x }
7575 | ---- ^^^^^^^^^^^^^^ lifetime `'a` required
7676 | |
7777 | help: add explicit lifetime `'a` to the type of `x`: `&'a i32`
7878
7979error[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
8181 |
8282LL | fn elided5(x: &i32) -> (Box<dyn Debug>, impl Debug) { (Box::new(x), x) }
8383 | ---- 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)
9292 | ++++
9393
9494error[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
9696 |
9797LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x }
9898 | ------- this data with lifetime `'a`... ^ ...is used here...
9999 |
100100note: ...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
102102 |
103103LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x }
104104 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -112,10 +112,10 @@ LL | fn with_bound<'a>(x: &'static i32) -> impl LifetimeTrait<'a> + 'static { x
112112 | ~~~~~~~~~~~~
113113
114114error[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
116116 |
117117LL | 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
119119LL | move |_| println!("{}", y)
120120 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
121121 |
@@ -125,7 +125,7 @@ LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32
125125 | ++++
126126
127127error[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
129129 |
130130LL | fn ty_param_wont_outlive_static<T:Debug>(x: T) -> impl Debug + 'static {
131131 | ^^^^^^^^^^^^^^^^^^^^ ...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
136136 | +++++++++
137137
138138error[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
140140 |
141141LL | fn elided3(x: &i32) -> Box<dyn Debug> { Box::new(x) }
142142 | ---- ^ ...is used and required to live as long as `'static` here
143143 | |
144144 | this data with an anonymous lifetime `'_`...
145145 |
146146note: `'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
148148 |
149149LL | fn elided3(x: &i32) -> Box<dyn Debug> { Box::new(x) }
150150 | ^^^^^^^^^ ----------- because of this returned expression
@@ -156,15 +156,15 @@ LL | fn elided3(x: &i32) -> Box<dyn Debug + '_> { Box::new(x) }
156156 | ++++
157157
158158error[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
160160 |
161161LL | fn explicit3<'a>(x: &'a i32) -> Box<dyn Debug> { Box::new(x) }
162162 | ------- ^ ...is used and required to live as long as `'static` here
163163 | |
164164 | this data with lifetime `'a`...
165165 |
166166note: `'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
168168 |
169169LL | fn explicit3<'a>(x: &'a i32) -> Box<dyn Debug> { Box::new(x) }
170170 | ^^^^^^^^^ ----------- because of this returned expression
@@ -176,15 +176,15 @@ LL | fn explicit3<'a>(x: &'a i32) -> Box<dyn Debug + 'a> { Box::new(x) }
176176 | ++++
177177
178178error[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
180180 |
181181LL | fn elided4(x: &i32) -> Box<dyn Debug + 'static> { Box::new(x) }
182182 | ---- ^ ...is used and required to live as long as `'static` here
183183 | |
184184 | this data with an anonymous lifetime `'_`...
185185 |
186186note: `'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
188188 |
189189LL | fn elided4(x: &i32) -> Box<dyn Debug + 'static> { Box::new(x) }
190190 | ^^^^^^^ ----------- because of this returned expression
@@ -200,13 +200,13 @@ LL | fn elided4(x: &'static i32) -> Box<dyn Debug + 'static> { Box::new(x) }
200200 | ~~~~~~~~~~~~
201201
202202error[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
204204 |
205205LL | fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'static> { Box::new(x) }
206206 | ------- this data with lifetime `'a`... ^ ...is used and required to live as long as `'static` here
207207 |
208208note: `'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
210210 |
211211LL | fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'static> { Box::new(x) }
212212 | ^^^^^^^ ----------- because of this returned expression
0 commit comments