// Make sure we don't treat missing associated items as rigid // during coherence, even if we know they've got an impossible // `Sized`-bound. As we check whether the self type is definitely // not `Sized` outside of coherence, this check can be incomplete. // // In this test we only use `impl Overlap for T` to normalize // the field of `MaybeUnsized` when checking whether it's // definitely not `Sized`. However, for `MaybeUnsized` we // could also use `impl Overlap for u32` for normalization, which // would result in a `Sized` type. cc #139000 struct MaybeUnsized, U>(>::MaybeUnsized); trait ReqSized { type Missing1 where Self: Sized; type Missing2 where Self: Sized; } impl ReqSized for MaybeUnsized {} struct W(T); trait Eq {} impl Eq for W {} trait RelateReqSized {} impl RelateReqSized for T where W: Eq {} trait Overlap { type MaybeUnsized: ?Sized; } impl Overlap for T { type MaybeUnsized = str; } impl Overlap for u32 //~^ ERROR conflicting implementations of trait `Overlap` for type `u32` where MaybeUnsized: RelateReqSized, { type MaybeUnsized = u32; } fn main() {}