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.
This commit is contained in:
Santiago Pastorino 2021-02-02 13:34:08 -03:00
parent 7aa602b84c
commit 7b69987985
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF

View file

@ -0,0 +1,43 @@
// check-pass
// compile-flags:-Cincremental=tmp/traits-assoc-type-macros
// This test case makes sure that we can compile with incremental compilation
// enabled when there are macros, traits, inheritance and associated types involved.
trait Deserializer {
type Error;
}
trait Deserialize {
fn deserialize<D>(_: D) -> D::Error
where
D: Deserializer;
}
macro_rules! impl_deserialize {
($name:ident) => {
impl Deserialize for $name {
fn deserialize<D>(_: D) -> D::Error
where
D: Deserializer,
{
loop {}
}
}
};
}
macro_rules! formats {
{
$($name:ident,)*
} => {
$(
pub struct $name;
impl_deserialize!($name);
)*
}
}
formats! { Foo, Bar, }
fn main() {}