Clarify implicit captures for RPITIT

This commit is contained in:
Michael Goulet
2024-09-29 13:49:32 -04:00
committed by Jubilee Young
parent a7dc98733d
commit 36076ecdc7
4 changed files with 30 additions and 11 deletions
@@ -2,9 +2,9 @@ error: `impl Trait` captures lifetime parameter, but it is not mentioned in `use
--> $DIR/rpitit.rs:11:19
|
LL | trait TraitLt<'a: 'a> {
| -- this lifetime parameter is captured
| -- all lifetime parameters originating from a trait are captured implicitly
LL | fn hello() -> impl Sized + use<Self>;
| ^^^^^^^^^^^^^^^^^^^^^^ lifetime captured due to being mentioned in the bounds of the `impl Trait`
| ^^^^^^^^^^^^^^^^^^^^^^
error: lifetime may not live long enough
--> $DIR/rpitit.rs:15:5