//@ build-pass //@ compile-flags: -Zinline-mir trait Storage { type Buffer: ?Sized; } struct Array; impl Storage for Array { type Buffer = [(); N]; } struct Slice; impl Storage for Slice { type Buffer = [()]; } struct Wrap { _b: S::Buffer, } fn coerce(this: &Wrap>) -> &Wrap where Array: Storage, { coerce_again(this) } fn coerce_again(this: &Wrap>) -> &Wrap { this } fn main() { let inner: Wrap> = Wrap { _b: [(); 1] }; let _: &Wrap = coerce(&inner); }