]>
git.proxmox.com Git - rustc.git/blob - src/test/incremental/hashes/match_expressions.rs
1 // This test case tests the incremental compilation hash (ICH) implementation
2 // for match expressions.
4 // The general pattern followed here is: Change one thing between rev1 and rev2
5 // and make sure that the hash has changed, then change nothing between rev2 and
6 // rev3 and make sure that the hash has not changed.
8 // build-pass (FIXME(62277): could be check-pass?)
9 // revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
10 // compile-flags: -Z query-dep-graph
11 // [cfail1]compile-flags: -Zincremental-ignore-spans
12 // [cfail2]compile-flags: -Zincremental-ignore-spans
13 // [cfail3]compile-flags: -Zincremental-ignore-spans
14 // [cfail4]compile-flags: -Zincremental-relative-spans
15 // [cfail5]compile-flags: -Zincremental-relative-spans
16 // [cfail6]compile-flags: -Zincremental-relative-spans
19 #![feature(rustc_attrs)]
22 // Add Arm ---------------------------------------------------------------------
23 #[cfg(any(cfail1,cfail4))]
24 pub fn add_arm(x
: u32) -> u32 {
33 #[cfg(not(any(cfail1,cfail4)))]
34 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
35 #[rustc_clean(cfg="cfail3")]
36 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
37 #[rustc_clean(cfg="cfail6")]
38 pub fn add_arm(x
: u32) -> u32 {
49 // Change Order Of Arms --------------------------------------------------------
50 #[cfg(any(cfail1,cfail4))]
51 pub fn change_order_of_arms(x
: u32) -> u32 {
59 #[cfg(not(any(cfail1,cfail4)))]
60 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir")]
61 #[rustc_clean(cfg="cfail3")]
62 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir")]
63 #[rustc_clean(cfg="cfail6")]
64 pub fn change_order_of_arms(x
: u32) -> u32 {
74 // Add Guard Clause ------------------------------------------------------------
75 #[cfg(any(cfail1,cfail4))]
76 pub fn add_guard_clause(x
: u32, y
: bool
) -> u32 {
84 #[cfg(not(any(cfail1,cfail4)))]
85 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
86 #[rustc_clean(cfg="cfail3")]
87 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
88 #[rustc_clean(cfg="cfail6")]
89 pub fn add_guard_clause(x
: u32, y
: bool
) -> u32 {
99 // Change Guard Clause ------------------------------------------------------------
100 #[cfg(any(cfail1,cfail4))]
101 pub fn change_guard_clause(x
: u32, y
: bool
) -> u32 {
109 #[cfg(not(any(cfail1,cfail4)))]
110 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
111 #[rustc_clean(cfg="cfail3")]
112 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
113 #[rustc_clean(cfg="cfail6")]
114 pub fn change_guard_clause(x
: u32, y
: bool
) -> u32 {
124 // Add @-Binding ---------------------------------------------------------------
125 #[cfg(any(cfail1,cfail4))]
126 pub fn add_at_binding(x
: u32) -> u32 {
134 #[cfg(not(any(cfail1,cfail4)))]
135 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
136 #[rustc_clean(cfg="cfail3")]
137 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
138 #[rustc_clean(cfg="cfail6")]
139 pub fn add_at_binding(x
: u32) -> u32 {
149 // Change Name of @-Binding ----------------------------------------------------
150 #[cfg(any(cfail1,cfail4))]
151 pub fn change_name_of_at_binding(x
: u32) -> u32 {
159 #[cfg(not(any(cfail1,cfail4)))]
160 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir")]
161 #[rustc_clean(cfg="cfail3")]
162 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir")]
163 #[rustc_clean(cfg="cfail6")]
164 pub fn change_name_of_at_binding(x
: u32) -> u32 {
174 // Change Simple Binding To Pattern --------------------------------------------
175 #[cfg(any(cfail1,cfail4))]
176 pub fn change_simple_name_to_pattern(x
: u32) -> u32 {
183 #[cfg(not(any(cfail1,cfail4)))]
184 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
185 #[rustc_clean(cfg="cfail3")]
186 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
187 #[rustc_clean(cfg="cfail6")]
188 pub fn change_simple_name_to_pattern(x
: u32) -> u32 {
197 // Change Name In Pattern ------------------------------------------------------
198 #[cfg(any(cfail1,cfail4))]
199 pub fn change_name_in_pattern(x
: u32) -> u32 {
207 #[cfg(not(any(cfail1,cfail4)))]
208 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir")]
209 #[rustc_clean(cfg="cfail3")]
210 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir")]
211 #[rustc_clean(cfg="cfail6")]
212 pub fn change_name_in_pattern(x
: u32) -> u32 {
222 // Change Mutability Of Binding In Pattern -------------------------------------
223 #[cfg(any(cfail1,cfail4))]
224 pub fn change_mutability_of_binding_in_pattern(x
: u32) -> u32 {
231 #[cfg(not(any(cfail1,cfail4)))]
232 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
233 #[rustc_clean(cfg="cfail3")]
234 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
235 #[rustc_clean(cfg="cfail6")]
236 pub fn change_mutability_of_binding_in_pattern(x
: u32) -> u32 {
245 // Add `ref` To Binding In Pattern -------------------------------------
246 #[cfg(any(cfail1,cfail4))]
247 pub fn add_ref_to_binding_in_pattern(x
: u32) -> u32 {
254 #[cfg(not(any(cfail1,cfail4)))]
255 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
256 #[rustc_clean(cfg="cfail3")]
257 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
258 #[rustc_clean(cfg="cfail6")]
259 pub fn add_ref_to_binding_in_pattern(x
: u32) -> u32 {
268 // Add `&` To Binding In Pattern -------------------------------------
269 #[cfg(any(cfail1,cfail4))]
270 pub fn add_amp_to_binding_in_pattern(x
: u32) -> u32 {
277 #[cfg(not(any(cfail1,cfail4)))]
278 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
279 #[rustc_clean(cfg="cfail3")]
280 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
281 #[rustc_clean(cfg="cfail6")]
282 pub fn add_amp_to_binding_in_pattern(x
: u32) -> u32 {
291 // Change RHS Of Arm -----------------------------------------------------------
292 #[cfg(any(cfail1,cfail4))]
293 pub fn change_rhs_of_arm(x
: u32) -> u32 {
301 #[cfg(not(any(cfail1,cfail4)))]
302 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir")]
303 #[rustc_clean(cfg="cfail3")]
304 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir")]
305 #[rustc_clean(cfg="cfail6")]
306 pub fn change_rhs_of_arm(x
: u32) -> u32 {
316 // Add Alternative To Arm ------------------------------------------------------
317 #[cfg(any(cfail1,cfail4))]
318 pub fn add_alternative_to_arm(x
: u32) -> u32 {
326 #[cfg(not(any(cfail1,cfail4)))]
327 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
328 #[rustc_clean(cfg="cfail3")]
329 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes,optimized_mir,typeck")]
330 #[rustc_clean(cfg="cfail6")]
331 pub fn add_alternative_to_arm(x
: u32) -> u32 {