]> git.lizzy.rs Git - rust.git/blob - tests/incremental/struct_add_field.rs
Rollup merge of #107700 - jyn514:tools-builder, r=Mark-Simulacrum
[rust.git] / tests / incremental / struct_add_field.rs
1 // Test incremental compilation tracking where we change field names
2 // in between revisions (hashing should be stable).
3
4 // revisions:rpass1 rpass2
5 // compile-flags: -Z query-dep-graph
6
7 #![feature(rustc_attrs)]
8
9 pub struct X {
10     pub x: u32,
11
12     #[cfg(rpass2)]
13     pub x2: u32,
14 }
15
16 pub struct EmbedX {
17     x: X
18 }
19
20 pub struct Y {
21     pub y: char
22 }
23
24 #[rustc_clean(except="fn_sig,typeck", cfg="rpass2")]
25 pub fn use_X(x: X) -> u32 {
26     x.x as u32
27 }
28
29 #[rustc_clean(except="typeck", cfg="rpass2")]
30 pub fn use_EmbedX(embed: EmbedX) -> u32 {
31     embed.x.x as u32
32 }
33
34 #[rustc_clean(cfg="rpass2")]
35 pub fn use_Y() {
36     let x: Y = Y { y: 'c' };
37 }
38
39 pub fn main() { }