summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/in-trait/async-and-ret-ref.stderr
blob: 7c9028a8cd53c8583941ea4314fef1568ab8bec3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
error[E0310]: the associated type `<Self as MyTrait>::{opaque#0}` may not live long enough
  --> $DIR/async-and-ret-ref.rs:7:5
   |
LL |     async fn foo() -> &'static impl T;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |     |
   |     the associated type `<Self as MyTrait>::{opaque#0}` must be valid for the static lifetime...
   |     ...so that the reference type `&'static impl T` does not outlive the data it points at
   |
   = help: consider adding an explicit lifetime bound `<Self as MyTrait>::{opaque#0}: 'static`...

error: aborting due to previous error

For more information about this error, try `rustc --explain E0310`.