]>
git.proxmox.com Git - rustc.git/blob - src/test/incremental/hashes/exported_vs_not.rs
1 // build-pass (FIXME(62277): could be check-pass?)
2 // revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
3 // compile-flags: -Z query-dep-graph -O
4 // [cfail1]compile-flags: -Zincremental-ignore-spans
5 // [cfail2]compile-flags: -Zincremental-ignore-spans
6 // [cfail3]compile-flags: -Zincremental-ignore-spans
7 // [cfail4]compile-flags: -Zincremental-relative-spans
8 // [cfail5]compile-flags: -Zincremental-relative-spans
9 // [cfail6]compile-flags: -Zincremental-relative-spans
12 #![feature(rustc_attrs)]
15 // Case 1: The function body is not exported to metadata. If the body changes,
16 // the hash of the hir_owner_nodes node should change, but not the hash of
17 // either the hir_owner or the Metadata node.
19 #[cfg(any(cfail1,cfail4))]
20 pub fn body_not_exported_to_metadata() -> u32 {
24 #[cfg(not(any(cfail1,cfail4)))]
25 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir")]
26 #[rustc_clean(cfg="cfail3")]
27 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir")]
28 #[rustc_clean(cfg="cfail6")]
29 pub fn body_not_exported_to_metadata() -> u32 {
35 // Case 2: The function body *is* exported to metadata because the function is
36 // marked as #[inline]. Only the hash of the hir_owner depnode should be
37 // unaffected by a change to the body.
39 #[cfg(any(cfail1,cfail4))]
41 pub fn body_exported_to_metadata_because_of_inline() -> u32 {
45 #[cfg(not(any(cfail1,cfail4)))]
46 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir")]
47 #[rustc_clean(cfg="cfail3")]
48 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir")]
49 #[rustc_clean(cfg="cfail6")]
51 pub fn body_exported_to_metadata_because_of_inline() -> u32 {
57 // Case 2: The function body *is* exported to metadata because the function is
58 // generic. Only the hash of the hir_owner depnode should be
59 // unaffected by a change to the body.
61 #[cfg(any(cfail1,cfail4))]
63 pub fn body_exported_to_metadata_because_of_generic() -> u32 {
67 #[cfg(not(any(cfail1,cfail4)))]
68 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir")]
69 #[rustc_clean(cfg="cfail3")]
70 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir")]
71 #[rustc_clean(cfg="cfail6")]
73 pub fn body_exported_to_metadata_because_of_generic() -> u32 {