Skip to content

Commit 954d89b

Browse files
incr.comp.: Cover indirect changes in struct ICH test case
1 parent 57d6ddd commit 954d89b

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

src/test/incremental/hashes/struct_defs.rs

+71
Original file line numberDiff line numberDiff line change
@@ -236,3 +236,74 @@ struct Visibility;
236236
#[rustc_clean(label="Hir", cfg="cfail3")]
237237
#[rustc_metadata_clean(cfg="cfail3")]
238238
pub struct Visibility;
239+
240+
241+
242+
243+
struct ReferencedType1;
244+
struct ReferencedType2;
245+
246+
// Tuple Struct Change Field Type Indirectly -----------------------------------
247+
mod tuple_struct_change_field_type_indirectly {
248+
#[cfg(cfail1)]
249+
use super::ReferencedType1 as FieldType;
250+
#[cfg(not(cfail1))]
251+
use super::ReferencedType2 as FieldType;
252+
253+
#[rustc_dirty(label="Hir", cfg="cfail2")]
254+
#[rustc_clean(label="Hir", cfg="cfail3")]
255+
#[rustc_metadata_dirty(cfg="cfail2")]
256+
#[rustc_metadata_clean(cfg="cfail3")]
257+
struct TupleStruct(FieldType);
258+
}
259+
260+
261+
// Record Struct Change Field Type Indirectly -----------------------------------
262+
mod record_struct_change_field_type_indirectly {
263+
#[cfg(cfail1)]
264+
use super::ReferencedType1 as FieldType;
265+
#[cfg(not(cfail1))]
266+
use super::ReferencedType2 as FieldType;
267+
268+
#[rustc_dirty(label="Hir", cfg="cfail2")]
269+
#[rustc_clean(label="Hir", cfg="cfail3")]
270+
#[rustc_metadata_dirty(cfg="cfail2")]
271+
#[rustc_metadata_clean(cfg="cfail3")]
272+
struct RecordStruct {
273+
_x: FieldType
274+
}
275+
}
276+
277+
278+
279+
280+
trait ReferencedTrait1 {}
281+
trait ReferencedTrait2 {}
282+
283+
// Change Trait Bound Indirectly -----------------------------------------------
284+
mod change_trait_bound_indirectly {
285+
#[cfg(cfail1)]
286+
use super::ReferencedTrait1 as Trait;
287+
#[cfg(not(cfail1))]
288+
use super::ReferencedTrait2 as Trait;
289+
290+
#[rustc_dirty(label="Hir", cfg="cfail2")]
291+
#[rustc_clean(label="Hir", cfg="cfail3")]
292+
#[rustc_metadata_dirty(cfg="cfail2")]
293+
#[rustc_metadata_clean(cfg="cfail3")]
294+
struct Struct<T: Trait>(T);
295+
}
296+
297+
// Change Trait Bound Indirectly In Where Clause -------------------------------
298+
mod change_trait_bound_indirectly_in_where_clause {
299+
#[cfg(cfail1)]
300+
use super::ReferencedTrait1 as Trait;
301+
#[cfg(not(cfail1))]
302+
use super::ReferencedTrait2 as Trait;
303+
304+
#[rustc_dirty(label="Hir", cfg="cfail2")]
305+
#[rustc_clean(label="Hir", cfg="cfail3")]
306+
#[rustc_metadata_dirty(cfg="cfail2")]
307+
#[rustc_metadata_clean(cfg="cfail3")]
308+
struct Struct<T>(T) where T : Trait;
309+
}

0 commit comments

Comments
 (0)