error[E0308]: mismatched types --> $DIR/issue-50716.rs:14:9 | LL | let _x = *s; | ^^ lifetime mismatch | = note: expected type `Sized` found type `Sized` note: the lifetime `'a` as defined on the function body at 9:8... --> $DIR/issue-50716.rs:9:8 | LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>) | ^^ = note: ...does not necessarily outlive the static lifetime error: aborting due to previous error For more information about this error, try `rustc --explain E0308`.