]> git.lizzy.rs Git - rust.git/blob - src/test/incremental/ich_nested_items.rs
Auto merge of #82980 - tmiasko:import-cold-multiplier, r=michaelwoerister
[rust.git] / src / test / incremental / ich_nested_items.rs
1 // Check that the hash of `foo` doesn't change just because we ordered
2 // the nested items (or even added new ones).
3
4 // revisions: cfail1 cfail2
5 // build-pass (FIXME(62277): could be check-pass?)
6 // compile-flags: -Z query-dep-graph
7
8 #![crate_type = "rlib"]
9 #![feature(rustc_attrs)]
10
11 #[rustc_clean(label = "hir_owner", cfg = "cfail2")]
12 #[rustc_dirty(label = "hir_owner_nodes", cfg = "cfail2")]
13 pub fn foo() {
14     #[cfg(cfail1)]
15     pub fn baz() {} // order is different...
16
17     // FIXME: Make "hir_owner" use `rustc_clean` here. Currently "hir_owner" includes a reference to
18     // the parent node, which is the statement holding this item. Changing the position of
19     // `bar` in `foo` will update that reference and make `hir_owner(bar)` dirty.
20     #[rustc_dirty(label = "hir_owner", cfg = "cfail2")]
21     #[rustc_clean(label = "hir_owner_nodes", cfg = "cfail2")]
22     pub fn bar() {} // but that doesn't matter.
23
24     #[cfg(cfail2)]
25     pub fn baz() {} // order is different...
26
27     pub fn bap() {} // neither does adding a new item
28 }