error[E0621]: explicit lifetime required in the type of `x`
  --> $DIR/impl-trait-captures.rs:10:25
   |
LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> {
   |                         ^^^^^^^^^^^^ lifetime `ReEarlyBound(0, 'a)` required
   |
help: add explicit lifetime `ReEarlyBound(0, 'a)` to the type of `x`
   |
LL | fn foo<'a, T>(x: &ReEarlyBound(0, 'a) T) -> impl Foo<'a> {
   |                  ^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

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