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
9 #![feature(rustc_attrs)]
12 // Case 1: The function body is not exported to metadata. If the body changes,
13 // the hash of the hir_owner_nodes node should change, but not the hash of
14 // either the hir_owner or the Metadata node.
16 #[cfg(any(cfail1,cfail4))]
17 pub fn body_not_exported_to_metadata() -> u32 {
21 #[cfg(not(any(cfail1,cfail4)))]
22 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir")]
23 #[rustc_clean(cfg="cfail3")]
24 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir")]
25 #[rustc_clean(cfg="cfail6")]
26 pub fn body_not_exported_to_metadata() -> u32 {
32 // Case 2: The function body *is* exported to metadata because the function is
33 // marked as #[inline]. Only the hash of the hir_owner depnode should be
34 // unaffected by a change to the body.
36 #[cfg(any(cfail1,cfail4))]
38 pub fn body_exported_to_metadata_because_of_inline() -> u32 {
42 #[cfg(not(any(cfail1,cfail4)))]
43 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir")]
44 #[rustc_clean(cfg="cfail3")]
45 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir")]
46 #[rustc_clean(cfg="cfail6")]
48 pub fn body_exported_to_metadata_because_of_inline() -> u32 {
54 // Case 2: The function body *is* exported to metadata because the function is
55 // generic. Only the hash of the hir_owner depnode should be
56 // unaffected by a change to the body.
58 #[cfg(any(cfail1,cfail4))]
60 pub fn body_exported_to_metadata_because_of_generic() -> u32 {
64 #[cfg(not(any(cfail1,cfail4)))]
65 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir")]
66 #[rustc_clean(cfg="cfail3")]
67 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir")]
68 #[rustc_clean(cfg="cfail6")]
70 pub fn body_exported_to_metadata_because_of_generic() -> u32 {