|
| 1 | +error: `impl Trait` captures lifetime parameter, but it is not mentioned in `use<...>` precise captures list |
| 2 | + --> $DIR/rpitit.rs:11:19 |
| 3 | + | |
| 4 | +LL | trait Foo<'a> { |
| 5 | + | -- this lifetime parameter is captured |
| 6 | +LL | fn hello() -> impl PartialEq + use<Self>; |
| 7 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime captured due to being mentioned in the bounds of the `impl Trait` |
| 8 | + |
| 9 | +error: lifetime may not live long enough |
| 10 | + --> $DIR/rpitit.rs:15:5 |
| 11 | + | |
| 12 | +LL | fn test<'a, 'b, T: for<'r> Foo<'r>>() { |
| 13 | + | -- -- lifetime `'b` defined here |
| 14 | + | | |
| 15 | + | lifetime `'a` defined here |
| 16 | +LL | / PartialEq::eq( |
| 17 | +LL | | &<T as Foo<'a>>::hello(), |
| 18 | +LL | | &<T as Foo<'b>>::hello(), |
| 19 | +LL | | ); |
| 20 | + | |_____^ argument requires that `'a` must outlive `'b` |
| 21 | + | |
| 22 | + = help: consider adding the following bound: `'a: 'b` |
| 23 | + |
| 24 | +error: lifetime may not live long enough |
| 25 | + --> $DIR/rpitit.rs:15:5 |
| 26 | + | |
| 27 | +LL | fn test<'a, 'b, T: for<'r> Foo<'r>>() { |
| 28 | + | -- -- lifetime `'b` defined here |
| 29 | + | | |
| 30 | + | lifetime `'a` defined here |
| 31 | +LL | / PartialEq::eq( |
| 32 | +LL | | &<T as Foo<'a>>::hello(), |
| 33 | +LL | | &<T as Foo<'b>>::hello(), |
| 34 | +LL | | ); |
| 35 | + | |_____^ argument requires that `'b` must outlive `'a` |
| 36 | + | |
| 37 | + = help: consider adding the following bound: `'b: 'a` |
| 38 | + |
| 39 | +help: `'a` and `'b` must be the same: replace one with the other |
| 40 | + |
| 41 | +error: aborting due to 3 previous errors |
| 42 | + |
0 commit comments