error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an explicit bound --> $DIR/object-lifetime-default-dyn-binding-nonstatic3.rs:16:36 | LL | fn bar(x: &str) -> &dyn Foo { &() } | ^^^^^^^ error[E0277]: the trait bound `(): Foo<'_>` is not satisfied --> $DIR/object-lifetime-default-dyn-binding-nonstatic3.rs:16:47 | LL | fn bar(x: &str) -> &dyn Foo { &() } | ^^^ the trait `Foo<'_>` is not implemented for `()` | help: this trait has no implementations, consider adding one --> $DIR/object-lifetime-default-dyn-binding-nonstatic3.rs:4:1 | LL | trait Foo<'a> { | ^^^^^^^^^^^^^ = note: required for the cast from `&()` to `&dyn Foo<'_, Item = dyn Bar>` error: aborting due to 2 previous errors Some errors have detailed explanations: E0228, E0277. For more information about an error, try `rustc --explain E0228`.