]> git.lizzy.rs Git - rust.git/blob - tests/incremental/hash-module-order.rs
Rollup merge of #107194 - xfix:remove-slice-internals-dependency-in-rustc-ast, r...
[rust.git] / tests / incremental / hash-module-order.rs
1 // revisions: rpass1 rpass2
2 // compile-flags: -Z incremental-ignore-spans -Z query-dep-graph
3
4 // Tests that module hashing depends on the order of the items
5 // (since the order is exposed through `Mod.item_ids`).
6 // Changing the order of items (while keeping `Span`s the same)
7 // should still result in `hir_owner` being invalidated.
8 // Note that it's possible to keep the spans unchanged using
9 // a proc-macro (e.g. producing the module via `quote!`)
10 // but we use `-Z incremental-ignore-spans` for simplicity
11
12 #![feature(rustc_attrs)]
13
14 #[cfg(rpass1)]
15 #[rustc_clean(cfg="rpass1",except="hir_owner")]
16 mod foo {
17     struct First;
18     struct Second;
19 }
20
21 #[cfg(rpass2)]
22 #[rustc_clean(cfg="rpass2",except="hir_owner")]
23 mod foo {
24     struct Second;
25     struct First;
26 }
27
28 fn main() {}