]> git.proxmox.com Git - rustc.git/blob - src/test/incremental/hello_world.rs
Imported Upstream version 1.9.0+dfsg1
[rustc.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
13 #![allow(warnings)]
14 #![feature(rustc_attrs)]
15
16 fn main() { }
17
18 mod x {
19 #[cfg(rpass1)]
20 pub fn x() -> i32 {
21 1
22 }
23
24 #[cfg(rpass2)]
25 pub fn x() -> i32 {
26 2
27 }
28 }
29
30 mod y {
31 use x;
32
33 #[rustc_dirty(label="TypeckItemBody", cfg="rpass2")]
34 pub fn y() {
35 x::x();
36 }
37 }
38
39 mod z {
40 use y;
41
42 #[rustc_clean(label="TypeckItemBody", cfg="rpass2")]
43 pub fn z() {
44 y::y();
45 }
46 }