rust/tests/ui/nll/ty-outlives/projection-where-clause-env-wrong-lifetime.stderr

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

15 lines
694 B
Plaintext
Raw Normal View History

error[E0309]: the associated type `<T as MyTrait<'_>>::Output` may not live long enough
2022-04-01 13:13:25 -04:00
--> $DIR/projection-where-clause-env-wrong-lifetime.rs:14:5
|
2023-09-17 14:32:02 +00:00
LL | fn foo1<'a, 'b, T>() -> &'a ()
| -- the associated type `<T as MyTrait<'_>>::Output` must be valid for the lifetime `'a` as defined here...
...
LL | bar::<<T as MyTrait<'a>>::Output>()
2023-09-17 14:32:02 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `<T as MyTrait<'_>>::Output` will meet its required lifetime bounds
|
= help: consider adding an explicit lifetime bound `<T as MyTrait<'_>>::Output: 'a`...
error: aborting due to previous error
For more information about this error, try `rustc --explain E0309`.