error[E0308]: mismatched types --> $DIR/issue-50716.rs:8:27 | LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>) | ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch | = note: expected trait `<<&'a T as A>::X as MetaSized>` found trait `<<&'static T as A>::X as MetaSized>` note: the lifetime `'a` as defined here... --> $DIR/issue-50716.rs:8:8 | LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>) | ^^ = note: ...does not necessarily outlive the static lifetime error: lifetime may not live long enough --> $DIR/issue-50716.rs:13:14 | LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>) | -- lifetime `'a` defined here ... LL | let _x = *s; | ^^ proving this value is `Sized` requires that `'a` must outlive `'static` error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`.