error[E0308]: mismatched types --> $DIR/variance-covariant-arg-object.rs:25:5 | LL | v //~ ERROR mismatched types | ^ lifetime mismatch | = note: expected type `dyn Get<&'min i32>` found type `dyn Get<&'max i32>` note: the lifetime 'min as defined on the function body at 20:21... --> $DIR/variance-covariant-arg-object.rs:20:21 | LL | fn get_min_from_max<'min, 'max>(v: Box>) | ^^^^ note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 20:27 --> $DIR/variance-covariant-arg-object.rs:20:27 | LL | fn get_min_from_max<'min, 'max>(v: Box>) | ^^^^ error[E0308]: mismatched types --> $DIR/variance-covariant-arg-object.rs:32:5 | LL | v //~ ERROR mismatched types | ^ lifetime mismatch | = note: expected type `dyn Get<&'max i32>` found type `dyn Get<&'min i32>` note: the lifetime 'min as defined on the function body at 28:21... --> $DIR/variance-covariant-arg-object.rs:28:21 | LL | fn get_max_from_min<'min, 'max, G>(v: Box>) | ^^^^ note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 28:27 --> $DIR/variance-covariant-arg-object.rs:28:27 | LL | fn get_max_from_min<'min, 'max, G>(v: Box>) | ^^^^ error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`.