Skip to content

Commit 868aa42

Browse files
Add a test that used to take forever to compile
1 parent c32527f commit 868aa42

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// check-pass
2+
// compile-flags: -Ztrait-solver=next
3+
// Issue 96230
4+
5+
use std::fmt::Debug;
6+
7+
trait Classic {
8+
type Assoc;
9+
}
10+
11+
trait Gat {
12+
type Assoc<'a>;
13+
}
14+
15+
struct Foo;
16+
17+
impl Classic for Foo {
18+
type Assoc = ();
19+
}
20+
21+
impl Gat for Foo {
22+
type Assoc<'i> = ();
23+
}
24+
25+
fn classic_debug<T: Classic>(_: T)
26+
where
27+
T::Assoc: Debug,
28+
{
29+
}
30+
31+
fn gat_debug<T: Gat>(_: T)
32+
where
33+
for<'a> T::Assoc<'a>: Debug,
34+
{
35+
}
36+
37+
fn main() {
38+
classic_debug::<Foo>(Foo); // fine
39+
classic_debug(Foo); // fine
40+
41+
gat_debug::<Foo>(Foo); // fine
42+
gat_debug(Foo); // boom
43+
}

0 commit comments

Comments
 (0)