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