]> git.lizzy.rs Git - rust.git/blob - src/test/incremental/struct_add_field.rs
Rollup merge of #56476 - GuillaumeGomez:invalid-line-number-match, r=QuietMisdreavus
[rust.git] / src / test / incremental / struct_add_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 pub struct X {
20     pub x: u32,
21
22     #[cfg(rpass2)]
23     pub x2: u32,
24 }
25
26 pub struct EmbedX {
27     x: X
28 }
29
30 pub struct Y {
31     pub y: char
32 }
33
34 #[rustc_dirty(label="TypeckTables", cfg="rpass2")]
35 pub fn use_X(x: X) -> u32 {
36     x.x as u32
37 }
38
39 #[rustc_dirty(label="TypeckTables", cfg="rpass2")]
40 pub fn use_EmbedX(embed: EmbedX) -> u32 {
41     embed.x.x as u32
42 }
43
44 #[rustc_clean(label="TypeckTables", cfg="rpass2")]
45 pub fn use_Y() {
46     let x: Y = Y { y: 'c' };
47 }
48
49 pub fn main() { }