]> git.lizzy.rs Git - rust.git/blob - src/test/incremental/struct_remove_field.rs
Rollup merge of #100338 - lyming2007:issue-100285-fix, r=petrochenkov
[rust.git] / src / test / incremental / struct_remove_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 #[cfg(rpass1)]
10 pub struct X {
11     pub x: u32,
12     pub x2: u32,
13 }
14
15 #[cfg(rpass2)]
16 pub struct X {
17     pub x: u32,
18 }
19
20 pub struct EmbedX {
21     x: X
22 }
23
24 pub struct Y {
25     pub y: char
26 }
27
28 #[rustc_clean(except="typeck,fn_sig", cfg="rpass2")]
29 pub fn use_X(x: X) -> u32 {
30     x.x as u32
31 }
32
33 #[rustc_clean(except="typeck", cfg="rpass2")]
34 pub fn use_EmbedX(embed: EmbedX) -> u32 {
35     embed.x.x as u32
36 }
37
38 #[rustc_clean(cfg="rpass2")]
39 pub fn use_Y() {
40     let x: Y = Y { y: 'c' };
41 }
42
43 pub fn main() { }