Skip to content

Commit 90b8131

Browse files
committed
Add regression test for issue #55846
1 parent b755501 commit 90b8131

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

src/test/ui/issue-55846.rs

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
}

0 commit comments

Comments
 (0)