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:
parent
7aa602b84c
commit
7b69987985
1 changed files with 43 additions and 0 deletions
|
|
@ -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() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue