error[E0308]: mismatched types --> $DIR/variance-contravariant-arg-object.rs:14:5 | LL | v | ^ lifetime mismatch | = note: expected trait object `dyn Get<&'min i32>` found trait object `dyn Get<&'max i32>` note: the lifetime `'min` as defined here... --> $DIR/variance-contravariant-arg-object.rs:10:21 | LL | fn get_min_from_max<'min, 'max>(v: Box>) | ^^^^ note: ...does not necessarily outlive the lifetime `'max` as defined here --> $DIR/variance-contravariant-arg-object.rs:10:27 | LL | fn get_min_from_max<'min, 'max>(v: Box>) | ^^^^ error[E0308]: mismatched types --> $DIR/variance-contravariant-arg-object.rs:22:5 | LL | v | ^ lifetime mismatch | = note: expected trait object `dyn Get<&'max i32>` found trait object `dyn Get<&'min i32>` note: the lifetime `'min` as defined here... --> $DIR/variance-contravariant-arg-object.rs:17:21 | LL | fn get_max_from_min<'min, 'max, G>(v: Box>) | ^^^^ note: ...does not necessarily outlive the lifetime `'max` as defined here --> $DIR/variance-contravariant-arg-object.rs:17: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`.