1 // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
12 // revisions: cfail1 cfail2 cfail3
13 // compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
16 #![feature(rustc_attrs)]
19 // Case 1: The function body is not exported to metadata. If the body changes,
20 // the hash of the HirBody node should change, but not the hash of
21 // either the Hir or the Metadata node.
24 pub fn body_not_exported_to_metadata() -> u32 {
29 #[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
30 #[rustc_clean(cfg="cfail3")]
31 pub fn body_not_exported_to_metadata() -> u32 {
37 // Case 2: The function body *is* exported to metadata because the function is
38 // marked as #[inline]. Only the hash of the Hir depnode should be
39 // unaffected by a change to the body.
43 pub fn body_exported_to_metadata_because_of_inline() -> u32 {
48 #[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
49 #[rustc_clean(cfg="cfail3")]
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 depnode should be
59 // unaffected by a change to the body.
63 pub fn body_exported_to_metadata_because_of_generic() -> u32 {
68 #[rustc_clean(cfg="cfail2", except="HirBody,MirValidated,MirOptimized")]
69 #[rustc_clean(cfg="cfail3")]
71 pub fn body_exported_to_metadata_because_of_generic() -> u32 {