summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/next-solver/alias-relate/deeply-nested-no-hang.rs
blob: 91cfda37adf633efd0c45641a22c45fad8966949 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// check-pass
// compile-flags: -Znext-solver
// regression test for trait-system-refactor-initiative#68
trait Identity {
    type Assoc: ?Sized;
}

impl<T: ?Sized> Identity for T {
    type Assoc = T;
}

type Id<T> = <T as Identity>::Assoc;

type Five<T> = Id<Id<Id<Id<Id<T>>>>>;
type Ty<T> = Five<Five<Five<Five<Five<T>>>>>;

trait Trait<T> {}

impl<T> Trait<T> for Ty<T> {}
impl Trait<u32> for Ty<i32> {}

fn main() {}