]> git.proxmox.com Git - rustc.git/blob - src/test/incremental/struct_remove_field.rs
New upstream version 1.12.0+dfsg1
[rustc.git] / src / test / incremental / struct_remove_field.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 // Test incremental compilation tracking where we change field names
12 // in between revisions (hashing should be stable).
13
14 // revisions:rpass1 rpass2
15 // compile-flags: -Z query-dep-graph
16
17 #![feature(rustc_attrs)]
18
19 #[cfg(rpass1)]
20 pub struct X {
21 pub x: u32,
22 pub x2: u32,
23 }
24
25 #[cfg(rpass2)]
26 pub struct X {
27 pub x: u32,
28 }
29
30 pub struct EmbedX {
31 x: X
32 }
33
34 pub struct Y {
35 pub y: char
36 }
37
38 #[rustc_dirty(label="TypeckItemBody", cfg="rpass2")]
39 pub fn use_X(x: X) -> u32 {
40 x.x as u32
41 }
42
43 #[rustc_dirty(label="TypeckItemBody", cfg="rpass2")]
44 pub fn use_EmbedX(embed: EmbedX) -> u32 {
45 embed.x.x as u32
46 }
47
48 #[rustc_clean(label="TypeckItemBody", cfg="rpass2")]
49 pub fn use_Y() {
50 let x: Y = Y { y: 'c' };
51 }
52
53 pub fn main() { }