rust/tests/ui/impl-trait/precise-capturing/rpitit.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.4 KiB
Plaintext
Raw Normal View History

error: `impl Trait` captures lifetime parameter, but it is not mentioned in `use<...>` precise captures list
2024-09-29 12:41:13 -05:00
--> $DIR/rpitit.rs:11:19
|
2024-09-29 12:41:13 -05:00
LL | trait TraitLt<'a: 'a> {
2024-09-29 12:49:32 -05:00
| -- all lifetime parameters originating from a trait are captured implicitly
2024-09-29 12:41:13 -05:00
LL | fn hello() -> impl Sized + use<Self>;
2024-09-29 12:49:32 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^
error: lifetime may not live long enough
2024-09-29 12:41:13 -05:00
--> $DIR/rpitit.rs:15:5
|
2024-09-29 12:41:13 -05:00
LL | fn trait_lt<'a, 'b, T: for<'r> TraitLt<'r>> () {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
LL | / eq_types(
LL | |
LL | |
LL | | <T as TraitLt<'a>>::hello(),
LL | | <T as TraitLt<'b>>::hello(),
LL | | );
| |_____^ argument requires that `'a` must outlive `'b`
|
= help: consider adding the following bound: `'a: 'b`
error: lifetime may not live long enough
2024-09-29 12:41:13 -05:00
--> $DIR/rpitit.rs:15:5
|
2024-09-29 12:41:13 -05:00
LL | fn trait_lt<'a, 'b, T: for<'r> TraitLt<'r>> () {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
LL | / eq_types(
LL | |
LL | |
LL | | <T as TraitLt<'a>>::hello(),
LL | | <T as TraitLt<'b>>::hello(),
LL | | );
| |_____^ argument requires that `'b` must outlive `'a`
|
= help: consider adding the following bound: `'b: 'a`
help: `'a` and `'b` must be the same: replace one with the other
2024-09-29 12:41:13 -05:00
error: aborting due to 3 previous errors