Skip to content

Commit 7b69987

Browse files
committed
Add regression test for ICE that happened on incr comp
An ICE happened when certain code is compiled in incremental compilation mode and there are two `Ident`s that have the same `StableHash` value but are considered different by `Eq` and `Hash`. The `Ident` issue is now fixed.
1 parent 7aa602b commit 7b69987

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:-Cincremental=tmp/traits-assoc-type-macros
3+
4+
// This test case makes sure that we can compile with incremental compilation
5+
// enabled when there are macros, traits, inheritance and associated types involved.
6+
7+
trait Deserializer {
8+
type Error;
9+
}
10+
11+
trait Deserialize {
12+
fn deserialize<D>(_: D) -> D::Error
13+
where
14+
D: Deserializer;
15+
}
16+
17+
macro_rules! impl_deserialize {
18+
($name:ident) => {
19+
impl Deserialize for $name {
20+
fn deserialize<D>(_: D) -> D::Error
21+
where
22+
D: Deserializer,
23+
{
24+
loop {}
25+
}
26+
}
27+
};
28+
}
29+
30+
macro_rules! formats {
31+
{
32+
$($name:ident,)*
33+
} => {
34+
$(
35+
pub struct $name;
36+
37+
impl_deserialize!($name);
38+
)*
39+
}
40+
}
41+
formats! { Foo, Bar, }
42+
43+
fn main() {}

0 commit comments

Comments
 (0)