]> git.lizzy.rs Git - rust.git/blob - src/test/incremental/hello_world.rs
Rollup merge of #35586 - shyaamsundhar:SqushCom, r=jonathandturner
[rust.git] / src / test / incremental / hello_world.rs
1 // Copyright 2014 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.
4 //
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.
10
11 // revisions: rpass1 rpass2
12 // compile-flags: -Z query-dep-graph
13
14 #![allow(warnings)]
15 #![feature(rustc_attrs)]
16
17 fn main() { }
18
19 mod x {
20     #[cfg(rpass1)]
21     pub fn x() -> i32 {
22         1
23     }
24
25     #[cfg(rpass2)]
26     pub fn x() -> i32 {
27         2
28     }
29 }
30
31 mod y {
32     use x;
33
34     #[rustc_dirty(label="TypeckItemBody", cfg="rpass2")]
35     pub fn y() {
36         x::x();
37     }
38 }
39
40 mod z {
41     use y;
42
43     #[rustc_clean(label="TypeckItemBody", cfg="rpass2")]
44     pub fn z() {
45         y::y();
46     }
47 }