trait Super { type Assoc; } impl Super for () { type Assoc = u8; } trait Sub: Super {} trait BoundOnSelf: Sub {} impl BoundOnSelf for () {} //~^ ERROR the trait bound `(): Sub` is not satisfied trait BoundOnParam {} impl BoundOnParam<()> for () {} //~^ ERROR the trait bound `(): Sub` is not satisfied trait BoundOnAssoc { type Assoc: Sub; } impl BoundOnAssoc for () { type Assoc = (); //~^ ERROR the trait bound `(): Sub` is not satisfied } trait BoundOnGat where Self::Assoc: Sub { type Assoc; } impl BoundOnGat for u8 { type Assoc = (); //~^ ERROR the trait bound `(): Sub` is not satisfied } fn trivial_bound() where (): Sub {} //~^ ERROR the trait bound `(): Sub` is not satisfied // The following is an edge case where the unsatisfied projection predicate // `<::Assoc1<()> as SuperGeneric>::Assoc == ::Assoc2` // contains both associated types of `MultiAssoc`. To suppress the error about the unsatisfied // super projection, the error's span must be equal to the span of the unsatisfied trait error. trait SuperGeneric { type Assoc; } trait SubGeneric: SuperGeneric {} trait MultiAssoc where Self::Assoc1<()>: SubGeneric { type Assoc1; type Assoc2; } impl SuperGeneric for () { type Assoc = u8; } impl MultiAssoc for u8 { type Assoc1 = (); //~^ ERROR the trait bound `(): SubGeneric` is not satisfied type Assoc2 = u16; } fn main() {}