]> git.lizzy.rs Git - rust.git/blob - src/test/ui/specialization/assoc-ty-graph-cycle.rs
54d51492ab3494b6ca0147ff1dca4b216da25fd1
[rust.git] / src / test / ui / specialization / assoc-ty-graph-cycle.rs
1 // run-pass
2
3 // Make sure we don't crash with a cycle error during coherence.
4
5 #![feature(specialization)]
6
7 trait Trait<T> {
8     type Assoc;
9 }
10
11 impl<T> Trait<T> for Vec<T> {
12     default type Assoc = ();
13 }
14
15 impl Trait<u8> for Vec<u8> {
16     type Assoc = u8;
17 }
18
19 impl<T> Trait<T> for String {
20     type Assoc = ();
21 }
22
23 impl Trait<<Vec<u8> as Trait<u8>>::Assoc> for String {}
24
25 fn main() {}