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 | ^^
@@ -80,21 +80,21 @@ LL | fn hrtb() -> impl for<'a> Higher<'a, Output = impl Sized + use<>> {}
8080 | +++++++
8181
8282error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
83- --> $DIR/overcaptures-2024.rs:32 :28
83+ --> $DIR/overcaptures-2024.rs:33 :28
8484 |
8585LL | fn apit(_: &impl Sized) -> impl Sized {}
8686 | ^^^^^^^^^^
8787 |
8888 = warning: this changes meaning in Rust 2024
8989 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
9090note: specifically, this lifetime is in scope but not mentioned in the type's bounds
91- --> $DIR/overcaptures-2024.rs:32 :12
91+ --> $DIR/overcaptures-2024.rs:33 :12
9292 |
9393LL | fn apit(_: &impl Sized) -> impl Sized {}
9494 | ^
9595 = note: all lifetimes in scope will be captured by `impl Trait`s in edition 2024
9696note: you could use a `use<...>` bound to explicitly specify captures, but argument-position `impl Trait`s are not nameable
97- --> $DIR/overcaptures-2024.rs:32 :13
97+ --> $DIR/overcaptures-2024.rs:33 :13
9898 |
9999LL | fn apit(_: &impl Sized) -> impl Sized {}
100100 | ^^^^^^^^^^
@@ -104,21 +104,21 @@ LL | fn apit<T: Sized>(_: &T) -> impl Sized + use<T> {}
104104 | ++++++++++ ~ ++++++++
105105
106106error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
107- --> $DIR/overcaptures-2024.rs:36 :38
107+ --> $DIR/overcaptures-2024.rs:37 :38
108108 |
109109LL | fn apit2<U>(_: &impl Sized, _: U) -> impl Sized {}
110110 | ^^^^^^^^^^
111111 |
112112 = warning: this changes meaning in Rust 2024
113113 = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
114114note: specifically, this lifetime is in scope but not mentioned in the type's bounds
115- --> $DIR/overcaptures-2024.rs:36 :16
115+ --> $DIR/overcaptures-2024.rs:37 :16
116116 |
117117LL | fn apit2<U>(_: &impl Sized, _: U) -> impl Sized {}
118118 | ^
119119 = note: all lifetimes in scope will be captured by `impl Trait`s in edition 2024
120120note: you could use a `use<...>` bound to explicitly specify captures, but argument-position `impl Trait`s are not nameable
121- --> $DIR/overcaptures-2024.rs:36 :17
121+ --> $DIR/overcaptures-2024.rs:37 :17
122122 |
123123LL | fn apit2<U>(_: &impl Sized, _: U) -> impl Sized {}
124124 | ^^^^^^^^^^
@@ -127,5 +127,24 @@ help: use the precise capturing `use<...>` syntax to make the captures explicit
127127LL | fn apit2<U, T: Sized>(_: &T, _: U) -> impl Sized + use<U, T> {}
128128 | ++++++++++ ~ +++++++++++
129129
130- error: aborting due to 6 previous errors
130+ error: `impl Sized` will capture more lifetimes than possibly intended in edition 2024
131+ --> $DIR/overcaptures-2024.rs:41:37
132+ |
133+ LL | async fn async_fn<'a>(x: &'a ()) -> impl Sized {}
134+ | ^^^^^^^^^^
135+ |
136+ = warning: this changes meaning in Rust 2024
137+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
138+ note: specifically, this lifetime is in scope but not mentioned in the type's bounds
139+ --> $DIR/overcaptures-2024.rs:41:19
140+ |
141+ LL | async fn async_fn<'a>(x: &'a ()) -> impl Sized {}
142+ | ^^
143+ = note: all lifetimes in scope will be captured by `impl Trait`s in edition 2024
144+ help: use the precise capturing `use<...>` syntax to make the captures explicit
145+ |
146+ LL | async fn async_fn<'a>(x: &'a ()) -> impl Sized + use<> {}
147+ | +++++++
148+
149+ error: aborting due to 7 previous errors
131150
0 commit comments