// Demonstrates a mostly-theoretical inference guidance now that we turn the where // clause on `Trait` into an item bound, given that we prefer item bounds somewhat // greedily in trait selection. trait Bound {} impl Bound for U {} trait Trait where <::Assoc as Other>::Assoc: Bound, { type Assoc: Other; } trait Other { type Assoc; } fn impls_trait, U>() -> Vec { vec![] } fn foo() { let mut vec_u = impls_trait::<<::Assoc as Other>::Assoc, _>(); vec_u.sort(); drop::>(vec_u); //~^ ERROR mismatched types } fn main() {}