11error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
2- --> $DIR/overcaptures-2024.rs:6 :29
2+ --> $DIR/overcaptures-2024.rs:7 :29
33 |
44LL | fn named<'a>(x: &'a i32) -> impl Sized { *x }
55 | ^^^^^^^^^^
66 |
77 = warning: this changes meaning in Rust 2024
88 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
99note: specifically, this lifetime is in scope but not mentioned in the type's bounds
10- --> $DIR/overcaptures-2024.rs:6 :10
10+ --> $DIR/overcaptures-2024.rs:7 :10
1111 |
1212LL | fn named<'a>(x: &'a i32) -> impl Sized { *x }
1313 | ^^
1414 = note: all lifetimes in scope will be captured by `impl Trait`s in edition 2024
1515note: the lint level is defined here
16- --> $DIR/overcaptures-2024.rs:4 :9
16+ --> $DIR/overcaptures-2024.rs:5 :9
1717 |
1818LL | #![deny(impl_trait_overcaptures)]
1919 | ^^^^^^^^^^^^^^^^^^^^^^^
@@ -23,15 +23,15 @@ LL | fn named<'a>(x: &'a i32) -> impl Sized + use<> { *x }
2323 | +++++++
2424
2525error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
26- --> $DIR/overcaptures-2024.rs:10 :25
26+ --> $DIR/overcaptures-2024.rs:11 :25
2727 |
2828LL | fn implicit(x: &i32) -> impl Sized { *x }
2929 | ^^^^^^^^^^
3030 |
3131 = warning: this changes meaning in Rust 2024
3232 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
3333note: specifically, this lifetime is in scope but not mentioned in the type's bounds
34- --> $DIR/overcaptures-2024.rs:10 :16
34+ --> $DIR/overcaptures-2024.rs:11 :16
3535 |
3636LL | fn implicit(x: &i32) -> impl Sized { *x }
3737 | ^
@@ -42,15 +42,15 @@ LL | fn implicit(x: &i32) -> impl Sized + use<> { *x }
4242 | +++++++
4343
4444error: `impl Sized + '_` will capture more lifetimes than possibly intended in edition 2024
45- --> $DIR/overcaptures-2024.rs:16 :33
45+ --> $DIR/overcaptures-2024.rs:17 :33
4646 |
4747LL | fn hello(&self, x: &i32) -> impl Sized + '_ { self }
4848 | ^^^^^^^^^^^^^^^
4949 |
5050 = warning: this changes meaning in Rust 2024
5151 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
5252note: specifically, this lifetime is in scope but not mentioned in the type's bounds
53- --> $DIR/overcaptures-2024.rs:16 :24
53+ --> $DIR/overcaptures-2024.rs:17 :24
5454 |
5555LL | fn hello(&self, x: &i32) -> impl Sized + '_ { self }
5656 | ^
@@ -61,15 +61,15 @@ LL | fn hello(&self, x: &i32) -> impl Sized + '_ + use<'_> { self }
6161 | +++++++++
6262
6363error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
64- --> $DIR/overcaptures-2024.rs:28 :47
64+ --> $DIR/overcaptures-2024.rs:29 :47
6565 |
6666LL | fn hrtb() -> impl for<'a> Higher<'a, Output = impl Sized> {}
6767 | ^^^^^^^^^^
6868 |
6969 = warning: this changes meaning in Rust 2024
7070 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
7171note: specifically, this lifetime is in scope but not mentioned in the type's bounds
72- --> $DIR/overcaptures-2024.rs:28 :23
72+ --> $DIR/overcaptures-2024.rs:29 :23
7373 |
7474LL | fn hrtb() -> impl for<'a> Higher<'a, Output = impl Sized> {}
7575 | ^^
@@ -79,5 +79,24 @@ help: use the precise capturing `use<...>` syntax to make the captures explicit
7979LL | fn hrtb() -> impl for<'a> Higher<'a, Output = impl Sized + use<>> {}
8080 | +++++++
8181
82- error: aborting due to 4 previous errors
82+ error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
83+ --> $DIR/overcaptures-2024.rs:33:37
84+ |
85+ LL | async fn async_fn<'a>(x: &'a ()) -> impl Sized {}
86+ | ^^^^^^^^^^
87+ |
88+ = warning: this changes meaning in Rust 2024
89+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
90+ note: specifically, this lifetime is in scope but not mentioned in the type's bounds
91+ --> $DIR/overcaptures-2024.rs:33:19
92+ |
93+ LL | async fn async_fn<'a>(x: &'a ()) -> impl Sized {}
94+ | ^^
95+ = note: all lifetimes in scope will be captured by `impl Trait`s in edition 2024
96+ help: use the precise capturing `use<...>` syntax to make the captures explicit
97+ |
98+ LL | async fn async_fn<'a>(x: &'a ()) -> impl Sized + use<> {}
99+ | +++++++
100+
101+ error: aborting due to 5 previous errors
83102
0 commit comments