]>
Commit | Line | Data |
---|---|---|
0731742a XL |
1 | // run-pass |
2 | ||
3 | // Regression test for #55846, which once caused an ICE. | |
4 | ||
5 | use std::marker::PhantomData; | |
6 | ||
7 | struct Foo; | |
8 | ||
9 | struct Bar<A> { | |
10 | a: PhantomData<A>, | |
11 | } | |
12 | ||
13 | impl Fooifier for Foo { | |
14 | type Assoc = Foo; | |
15 | } | |
16 | ||
17 | trait Fooifier { | |
18 | type Assoc; | |
19 | } | |
20 | ||
21 | trait Barifier<H> { | |
22 | fn barify(); | |
23 | } | |
24 | ||
25 | impl<H> Barifier<H> for Bar<H> { | |
26 | fn barify() { | |
27 | println!("All correct!"); | |
28 | } | |
29 | } | |
30 | ||
31 | impl Bar<<Foo as Fooifier>::Assoc> { | |
32 | fn this_shouldnt_crash() { | |
33 | <Self as Barifier<<Foo as Fooifier>::Assoc>>::barify(); | |
34 | } | |
35 | } | |
36 | ||
37 | fn main() { | |
38 | Bar::<Foo>::this_shouldnt_crash(); | |
39 | } |