error[E0657]: `impl Trait` cannot capture higher-ranked lifetime from `dyn` type --> $DIR/implicit-capture-late.rs:10:55 | LL | fn foo(x: Vec) -> Box Deref> { | ^^^^^^^^^^^ `impl Trait` implicitly captures all lifetimes in scope | note: lifetime declared here --> $DIR/implicit-capture-late.rs:10:36 | LL | fn foo(x: Vec) -> Box Deref> { | ^^ error: [o] --> $DIR/implicit-capture-late.rs:10:55 | LL | fn foo(x: Vec) -> Box Deref> { | ^^^^^^^^^^^ error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0657`.