Skip to content

Commit a11de41

Browse files
Rollup merge of #56661 - aelred:issue-55846, r=Mark-Simulacrum
Add regression test for ICE Fixes #55846 with a minimal (or as best as I can manage) test case. I tested this against 1.30.0 manually to confirm it crashes. The issue seemed to have something to do with associated types. It's possible someone with more knowledge can shrink the test case down further, or make it clearer.
2 parents b3f1650 + 90b8131 commit a11de41

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)