]> git.lizzy.rs Git - rust.git/blob - src/test/incremental/ich_nested_items.rs
Rollup merge of #70038 - DutchGhost:const-forget-tests, r=RalfJung
[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
7 #![crate_type = "rlib"]
8 #![feature(rustc_attrs)]
9
10 #[rustc_clean(label = "hir_owner", cfg = "cfail2")]
11 #[rustc_dirty(label = "hir_owner_items", cfg = "cfail2")]
12 pub fn foo() {
13     #[cfg(cfail1)]
14     pub fn baz() {} // order is different...
15
16     // FIXME: Make "hir_owner" use `rustc_clean` here. Currently "hir_owner" includes a reference to
17     // the parent node, which is the statement holding this item. Changing the position of
18     // `bar` in `foo` will update that reference and make `hir_owner(bar)` dirty.
19     #[rustc_dirty(label = "hir_owner", cfg = "cfail2")]
20     #[rustc_clean(label = "hir_owner_items", cfg = "cfail2")]
21     pub fn bar() {} // but that doesn't matter.
22
23     #[cfg(cfail2)]
24     pub fn baz() {} // order is different...
25
26     pub fn bap() {} // neither does adding a new item
27 }