about summary refs log tree commit diff
path: root/tests/ui/traits/next-solver/overflow/recursive-self-normalization-2.rs
blob: 0f01a453b332eeb32ecdaef8b72a9a85724e26c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//@ compile-flags: -Znext-solver

trait Foo1 {
    type Assoc1;
}

trait Foo2 {
    type Assoc2;
}

trait Bar {}
fn needs_bar<S: Bar>() {}

fn test<T: Foo1<Assoc1 = <T as Foo2>::Assoc2> + Foo2<Assoc2 = <T as Foo1>::Assoc1>>() {
    needs_bar::<T::Assoc1>();
    //~^ ERROR overflow evaluating the requirement `<T as Foo1>::Assoc1 == _`
    //~| ERROR overflow evaluating the requirement `<T as Foo1>::Assoc1 == _`
    //~| ERROR overflow evaluating the requirement `<T as Foo1>::Assoc1 == _`
    //~| ERROR overflow evaluating the requirement `<T as Foo1>::Assoc1 == _`
    //~| ERROR overflow evaluating the requirement `<T as Foo1>::Assoc1: Sized`
    //~| ERROR overflow evaluating the requirement `<T as Foo1>::Assoc1: Bar`
}

fn main() {}