]> git.proxmox.com Git - rustc.git/blob - tests/incremental/struct_change_nothing.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / incremental / struct_change_nothing.rs
1 // Test incremental compilation tracking where we change nothing
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 }
13
14 #[cfg(rpass2)]
15 pub struct X {
16 pub x: u32
17 }
18
19 pub struct EmbedX {
20 x: X
21 }
22
23 pub struct Y {
24 pub y: char
25 }
26
27 #[rustc_clean(cfg="rpass2")]
28 pub fn use_X() -> u32 {
29 let x: X = X { x: 22 };
30 x.x as u32
31 }
32
33 #[rustc_clean(cfg="rpass2")]
34 pub fn use_EmbedX(x: EmbedX) -> u32 {
35 let x: X = X { x: 22 };
36 x.x as u32
37 }
38
39 #[rustc_clean(cfg="rpass2")]
40 pub fn use_Y() {
41 let x: Y = Y { y: 'c' };
42 }
43
44 pub fn main() { }