@@ -4,6 +4,8 @@ error: `impl Sized` will capture more lifetimes than possibly intended in editio
44LL | fn named<'a>(x: &'a i32) -> impl Sized { *x }
55 | ^^^^^^^^^^
66 |
7+ = warning: this changes meaning in Rust 2024
8+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
79note: specifically, this lifetime is in scope but not mentioned in the type's bounds
810 --> $DIR/overcaptures-2024.rs:6:10
911 |
@@ -21,13 +23,15 @@ LL | fn named<'a>(x: &'a i32) -> impl Sized + use<> { *x }
2123 | +++++++
2224
2325error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
24- --> $DIR/overcaptures-2024.rs:9 :25
26+ --> $DIR/overcaptures-2024.rs:10 :25
2527 |
2628LL | fn implicit(x: &i32) -> impl Sized { *x }
2729 | ^^^^^^^^^^
2830 |
31+ = warning: this changes meaning in Rust 2024
32+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
2933note: specifically, this lifetime is in scope but not mentioned in the type's bounds
30- --> $DIR/overcaptures-2024.rs:9 :16
34+ --> $DIR/overcaptures-2024.rs:10 :16
3135 |
3236LL | fn implicit(x: &i32) -> impl Sized { *x }
3337 | ^
@@ -38,13 +42,15 @@ LL | fn implicit(x: &i32) -> impl Sized + use<> { *x }
3842 | +++++++
3943
4044error: `impl Sized + '_` will capture more lifetimes than possibly intended in edition 2024
41- --> $DIR/overcaptures-2024.rs:14 :33
45+ --> $DIR/overcaptures-2024.rs:16 :33
4246 |
4347LL | fn hello(&self, x: &i32) -> impl Sized + '_ { self }
4448 | ^^^^^^^^^^^^^^^
4549 |
50+ = warning: this changes meaning in Rust 2024
51+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
4652note: specifically, this lifetime is in scope but not mentioned in the type's bounds
47- --> $DIR/overcaptures-2024.rs:14 :24
53+ --> $DIR/overcaptures-2024.rs:16 :24
4854 |
4955LL | fn hello(&self, x: &i32) -> impl Sized + '_ { self }
5056 | ^
@@ -55,13 +61,15 @@ LL | fn hello(&self, x: &i32) -> impl Sized + '_ + use<'_> { self }
5561 | +++++++++
5662
5763error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
58- --> $DIR/overcaptures-2024.rs:25 :47
64+ --> $DIR/overcaptures-2024.rs:28 :47
5965 |
6066LL | fn hrtb() -> impl for<'a> Higher<'a, Output = impl Sized> {}
6167 | ^^^^^^^^^^
6268 |
69+ = warning: this changes meaning in Rust 2024
70+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
6371note: specifically, this lifetime is in scope but not mentioned in the type's bounds
64- --> $DIR/overcaptures-2024.rs:25 :23
72+ --> $DIR/overcaptures-2024.rs:28 :23
6573 |
6674LL | fn hrtb() -> impl for<'a> Higher<'a, Output = impl Sized> {}
6775 | ^^
0 commit comments