Skip to content

Commit e28b485

Browse files
committed
add regression test
1 parent 34a8766 commit e28b485

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// revisions: next old
2+
//[next] compile-flags: -Znext-solver
3+
//@ check-pass
4+
// Regression test for https://github.com/rust-lang/rust/issues/154173.
5+
// The ICE there was caused by a (flawed) attempt to eagerly normalize during generalization.
6+
// The normalize would constrain other inference variables, which we couldn't deal with.
7+
8+
trait Trait<T> {
9+
type Assoc;
10+
}
11+
12+
impl Trait<u32> for () {
13+
type Assoc = u32;
14+
}
15+
16+
trait Eq {}
17+
impl<C: Trait<T>, T> Eq for (C, T, <C as Trait<T>>::Assoc) {}
18+
fn foo<A>()
19+
where
20+
((), A, A): Eq
21+
{}
22+
23+
fn main() {
24+
foo::<_>();
25+
}

0 commit comments

Comments
 (0)