error[E0308]: mismatched types --> $DIR/variance-associated-types2.rs:13:42 | LL | let _: Box> = make(); | ^^^^^^ lifetime mismatch | = note: expected trait object `dyn Foo` found trait object `dyn Foo` note: the lifetime `'a` as defined here... --> $DIR/variance-associated-types2.rs:12:9 | LL | fn take<'a>(_: &'a u32) { | ^^ = note: ...does not necessarily outlive the static lifetime error: aborting due to previous error For more information about this error, try `rustc --explain E0308`.