You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of #132817 - compiler-errors:impl-trait-overcaptures-apit, r=BoxyUwU
Recurse into APITs in `impl_trait_overcaptures`
We were previously not detecting cases where an RPIT was located in the return type of an async function, leading to underfiring of the `impl_trait_overcaptures`. This PR does this recursion properly now.
cc #132809
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
9
9
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
error: `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
27
27
|
28
28
LL | fn implicit(x: &i32) -> impl Sized { *x }
29
29
| ^^^^^^^^^^
30
30
|
31
31
= warning: this changes meaning in Rust 2024
32
32
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
33
33
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
52
52
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
71
71
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
error: `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
84
84
|
85
85
LL | fn apit(_: &impl Sized) -> impl Sized {}
86
86
| ^^^^^^^^^^
87
87
|
88
88
= warning: this changes meaning in Rust 2024
89
89
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
90
90
note: 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
92
92
|
93
93
LL | fn apit(_: &impl Sized) -> impl Sized {}
94
94
| ^
95
95
= note: all lifetimes in scope will be captured by `impl Trait`s in edition 2024
96
96
note: you could use a `use<...>` bound to explicitly specify captures, but argument-position `impl Trait`s are not nameable
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/rpit-lifetime-capture.html>
114
114
note: specifically, this lifetime is in scope but not mentioned in the type's bounds
= 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
0 commit comments