11error[E0597]: `x` does not live long enough
2- --> $DIR/migration-note.rs:182 :17
2+ --> $DIR/migration-note.rs:184 :17
33 |
44LL | let x = vec![0];
55 | - binding `x` declared here
5050LL | }
5151 | - `x` dropped here while still borrowed
5252 |
53+ note: requirement that `x` is borrowed for `'static` introduced here
54+ --> $DIR/migration-note.rs:34:37
55+ |
56+ LL | fn needs_static(_: impl Sized + 'static) {}
57+ | ^^^^^^^
5358note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
5459 --> $DIR/migration-note.rs:29:13
5560 |
@@ -61,7 +66,7 @@ LL | fn display_len<T>(x: &Vec<T>) -> impl Display + use<T> {
6166 | ++++++++
6267
6368error[E0505]: cannot move out of `x` because it is borrowed
64- --> $DIR/migration-note.rs:48 :8
69+ --> $DIR/migration-note.rs:49 :8
6570 |
6671LL | let x = vec![1];
6772 | - binding `x` declared here
7681 | - borrow might be used here, when `a` is dropped and runs the destructor for type `impl std::fmt::Display`
7782 |
7883note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
79- --> $DIR/migration-note.rs:43 :13
84+ --> $DIR/migration-note.rs:44 :13
8085 |
8186LL | let a = display_len(&x);
8287 | ^^^^^^^^^^^^^^^
@@ -90,7 +95,7 @@ LL | let a = display_len(&x.clone());
9095 | ++++++++
9196
9297error[E0499]: cannot borrow `x` as mutable more than once at a time
93- --> $DIR/migration-note.rs:66 :5
98+ --> $DIR/migration-note.rs:67 :5
9499 |
95100LL | let a = display_len_mut(&mut x);
96101 | ------ first mutable borrow occurs here
@@ -102,7 +107,7 @@ LL | println!("{a}");
102107 | - first borrow later used here
103108 |
104109note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
105- --> $DIR/migration-note.rs:63 :13
110+ --> $DIR/migration-note.rs:64 :13
106111 |
107112LL | let a = display_len_mut(&mut x);
108113 | ^^^^^^^^^^^^^^^^^^^^^^^
@@ -112,7 +117,7 @@ LL | fn display_len_mut<T>(x: &mut Vec<T>) -> impl Display + use<T> {
112117 | ++++++++
113118
114119error[E0597]: `x` does not live long enough
115- --> $DIR/migration-note.rs:76 :29
120+ --> $DIR/migration-note.rs:77 :29
116121 |
117122LL | let mut x = vec![1];
118123 | ----- binding `x` declared here
@@ -126,8 +131,13 @@ LL |
126131LL | }
127132 | - `x` dropped here while still borrowed
128133 |
134+ note: requirement that `x` is borrowed for `'static` introduced here
135+ --> $DIR/migration-note.rs:82:37
136+ |
137+ LL | fn needs_static(_: impl Sized + 'static) {}
138+ | ^^^^^^^
129139note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
130- --> $DIR/migration-note.rs:76 :13
140+ --> $DIR/migration-note.rs:77 :13
131141 |
132142LL | let a = display_len_mut(&mut x);
133143 | ^^^^^^^^^^^^^^^^^^^^^^^
@@ -137,7 +147,7 @@ LL | fn display_len_mut<T>(x: &mut Vec<T>) -> impl Display + use<T> {
137147 | ++++++++
138148
139149error[E0505]: cannot move out of `x` because it is borrowed
140- --> $DIR/migration-note.rs:95 :8
150+ --> $DIR/migration-note.rs:97 :8
141151 |
142152LL | let mut x = vec![1];
143153 | ----- binding `x` declared here
@@ -152,7 +162,7 @@ LL | }
152162 | - borrow might be used here, when `a` is dropped and runs the destructor for type `impl std::fmt::Display`
153163 |
154164note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
155- --> $DIR/migration-note.rs:90 :13
165+ --> $DIR/migration-note.rs:92 :13
156166 |
157167LL | let a = display_len_mut(&mut x);
158168 | ^^^^^^^^^^^^^^^^^^^^^^^
@@ -166,7 +176,7 @@ LL | let a = display_len_mut(&mut x.clone());
166176 | ++++++++
167177
168178error[E0506]: cannot assign to `s.f` because it is borrowed
169- --> $DIR/migration-note.rs:115 :5
179+ --> $DIR/migration-note.rs:117 :5
170180 |
171181LL | let a = display_field(&s.f);
172182 | ---- `s.f` is borrowed here
@@ -178,7 +188,7 @@ LL | println!("{a}");
178188 | - borrow later used here
179189 |
180190note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
181- --> $DIR/migration-note.rs:112 :13
191+ --> $DIR/migration-note.rs:114 :13
182192 |
183193LL | let a = display_field(&s.f);
184194 | ^^^^^^^^^^^^^^^^^^^
@@ -188,7 +198,7 @@ LL | fn display_field<T: Copy + Display>(t: &T) -> impl Display + use<T> {
188198 | ++++++++
189199
190200error[E0506]: cannot assign to `s.f` because it is borrowed
191- --> $DIR/migration-note.rs:131 :5
201+ --> $DIR/migration-note.rs:133 :5
192202 |
193203LL | let a = display_field(&mut s.f);
194204 | -------- `s.f` is borrowed here
@@ -200,7 +210,7 @@ LL | println!("{a}");
200210 | - borrow later used here
201211 |
202212note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
203- --> $DIR/migration-note.rs:128 :13
213+ --> $DIR/migration-note.rs:130 :13
204214 |
205215LL | let a = display_field(&mut s.f);
206216 | ^^^^^^^^^^^^^^^^^^^^^^^
@@ -210,7 +220,7 @@ LL | fn display_field<T: Copy + Display>(t: &T) -> impl Display + use<T> {
210220 | ++++++++
211221
212222error[E0503]: cannot use `s.f` because it was mutably borrowed
213- --> $DIR/migration-note.rs:143 :5
223+ --> $DIR/migration-note.rs:145 :5
214224 |
215225LL | let a = display_field(&mut s.f);
216226 | -------- `s.f` is borrowed here
@@ -222,7 +232,7 @@ LL | println!("{a}");
222232 | - borrow later used here
223233 |
224234note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
225- --> $DIR/migration-note.rs:140 :13
235+ --> $DIR/migration-note.rs:142 :13
226236 |
227237LL | let a = display_field(&mut s.f);
228238 | ^^^^^^^^^^^^^^^^^^^^^^^
@@ -232,7 +242,7 @@ LL | fn display_field<T: Copy + Display>(t: &T) -> impl Display + use<T> {
232242 | ++++++++
233243
234244error[E0597]: `z.f` does not live long enough
235- --> $DIR/migration-note.rs:159 :25
245+ --> $DIR/migration-note.rs:161 :25
236246 |
237247LL | let z = Z { f: vec![1] };
238248 | - binding `z` declared here
@@ -248,7 +258,7 @@ LL | }
248258 |
249259 = note: values in a scope are dropped in the opposite order they are defined
250260note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
251- --> $DIR/migration-note.rs:159 :13
261+ --> $DIR/migration-note.rs:161 :13
252262 |
253263LL | x = display_len(&z.f);
254264 | ^^^^^^^^^^^^^^^^^
@@ -258,7 +268,7 @@ LL | fn display_len<T>(x: &Vec<T>) -> impl Display + use<T> {
258268 | ++++++++
259269
260270error[E0716]: temporary value dropped while borrowed
261- --> $DIR/migration-note.rs:170 :40
271+ --> $DIR/migration-note.rs:172 :40
262272 |
263273LL | let x = { let x = display_len(&mut vec![0]); x };
264274 | ^^^^^^^ - - borrow later used here
@@ -268,7 +278,7 @@ LL | let x = { let x = display_len(&mut vec![0]); x };
268278 |
269279 = note: consider using a `let` binding to create a longer lived value
270280note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
271- --> $DIR/migration-note.rs:170 :23
281+ --> $DIR/migration-note.rs:172 :23
272282 |
273283LL | let x = { let x = display_len(&mut vec![0]); x };
274284 | ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -279,7 +289,7 @@ LL | fn display_len<T>(x: &Vec<T>) -> impl Display + use<T> {
279289 | ++++++++
280290
281291error[E0505]: cannot move out of `x` because it is borrowed
282- --> $DIR/migration-note.rs:198 :10
292+ --> $DIR/migration-note.rs:200 :10
283293 |
284294LL | let x = String::new();
285295 | - binding `x` declared here
@@ -294,12 +304,12 @@ LL | }
294304 | - borrow might be used here, when `y` is dropped and runs the destructor for type `impl Sized`
295305 |
296306note: this call may capture more lifetimes than intended, because Rust 2024 has adjusted the `impl Trait` lifetime capture rules
297- --> $DIR/migration-note.rs:195 :13
307+ --> $DIR/migration-note.rs:197 :13
298308 |
299309LL | let y = capture_apit(&x);
300310 | ^^^^^^^^^^^^^^^^
301311note: you could use a `use<...>` bound to explicitly specify captures, but argument-position `impl Trait`s are not nameable
302- --> $DIR/migration-note.rs:189 :21
312+ --> $DIR/migration-note.rs:191 :21
303313 |
304314LL | fn capture_apit(x: &impl Sized) -> impl Sized {}
305315 | ^^^^^^^^^^
0 commit comments