Skip to content

Commit

Permalink
Add regression test for ICE that happened on incr comp
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
spastorino committed Feb 5, 2021
1 parent 7aa602b commit 7b69987
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/test/ui/associated-type-bounds/traits-assoc-type-macros.rs
@@ -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() {}

0 comments on commit 7b69987

Please sign in to comment.