about summary refs log tree commit diff
path: root/tests/ui/dyn-compatibility/require-assoc-for-all-super-substs.rs
blob: 1f4e1bf653a3fb8d724bfc917f93f99af270abd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
trait Sup<T> {
    type Assoc: Default;
}

impl<T: Default> Sup<T> for () {
    type Assoc = T;
}
impl<T: Default, U: Default> Dyn<T, U> for () {}

trait Dyn<A, B>: Sup<A, Assoc = A> + Sup<B> {}

fn main() {
    let q: <dyn Dyn<i32, u32> as Sup<u32>>::Assoc = Default::default();
    //~^ ERROR the value of the associated type `Assoc` in `Sup<u32>` must be specified
}