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
10 // compile-flags: -Z query-dep-graph -Zincremental-ignore-spans
14 #![feature(rustc_attrs)]
17 // Add Arm ---------------------------------------------------------------------
19 pub fn add_arm(x: u32) -> u32 {
28 #[rustc_clean(cfg="cfail2",
29 except="hir_owner_nodes,mir_built,optimized_mir,typeck_tables_of")]
30 #[rustc_clean(cfg="cfail3")]
31 pub fn add_arm(x: u32) -> u32 {
42 // Change Order Of Arms --------------------------------------------------------
44 pub fn change_order_of_arms(x: u32) -> u32 {
53 #[rustc_clean(cfg="cfail2",
54 except="hir_owner_nodes,mir_built,optimized_mir")]
55 #[rustc_clean(cfg="cfail3")]
56 pub fn change_order_of_arms(x: u32) -> u32 {
66 // Add Guard Clause ------------------------------------------------------------
68 pub fn add_guard_clause(x: u32, y: bool) -> u32 {
77 #[rustc_clean(cfg="cfail2",
78 except="hir_owner_nodes,mir_built,optimized_mir,typeck_tables_of")]
79 #[rustc_clean(cfg="cfail3")]
80 pub fn add_guard_clause(x: u32, y: bool) -> u32 {
90 // Change Guard Clause ------------------------------------------------------------
92 pub fn change_guard_clause(x: u32, y: bool) -> u32 {
101 #[rustc_clean(cfg="cfail2",
102 except="hir_owner_nodes,mir_built,optimized_mir,typeck_tables_of")]
103 #[rustc_clean(cfg="cfail3")]
104 pub fn change_guard_clause(x: u32, y: bool) -> u32 {
114 // Add @-Binding ---------------------------------------------------------------
116 pub fn add_at_binding(x: u32) -> u32 {
125 #[rustc_clean(cfg="cfail2",
126 except="hir_owner_nodes,mir_built,optimized_mir,typeck_tables_of")]
127 #[rustc_clean(cfg="cfail3")]
128 pub fn add_at_binding(x: u32) -> u32 {
138 // Change Name of @-Binding ----------------------------------------------------
140 pub fn change_name_of_at_binding(x: u32) -> u32 {
149 #[rustc_clean(cfg="cfail2",
150 except="hir_owner_nodes,mir_built,optimized_mir")]
151 #[rustc_clean(cfg="cfail3")]
152 pub fn change_name_of_at_binding(x: u32) -> u32 {
162 // Change Simple Binding To Pattern --------------------------------------------
164 pub fn change_simple_name_to_pattern(x: u32) -> u32 {
172 #[rustc_clean(cfg="cfail2",
173 except="hir_owner_nodes,mir_built,optimized_mir,typeck_tables_of")]
174 #[rustc_clean(cfg="cfail3")]
175 pub fn change_simple_name_to_pattern(x: u32) -> u32 {
184 // Change Name In Pattern ------------------------------------------------------
186 pub fn change_name_in_pattern(x: u32) -> u32 {
195 #[rustc_clean(cfg="cfail2",
196 except="hir_owner_nodes,mir_built,optimized_mir")]
197 #[rustc_clean(cfg="cfail3")]
198 pub fn change_name_in_pattern(x: u32) -> u32 {
208 // Change Mutability Of Binding In Pattern -------------------------------------
210 pub fn change_mutability_of_binding_in_pattern(x: u32) -> u32 {
218 #[rustc_clean(cfg="cfail2",
219 except="hir_owner_nodes,mir_built,optimized_mir,typeck_tables_of")]
220 #[rustc_clean(cfg="cfail3")]
221 pub fn change_mutability_of_binding_in_pattern(x: u32) -> u32 {
230 // Add `ref` To Binding In Pattern -------------------------------------
232 pub fn add_ref_to_binding_in_pattern(x: u32) -> u32 {
240 #[rustc_clean(cfg="cfail2",
241 except="hir_owner_nodes,mir_built,optimized_mir,typeck_tables_of")]
242 #[rustc_clean(cfg="cfail3")]
243 pub fn add_ref_to_binding_in_pattern(x: u32) -> u32 {
252 // Add `&` To Binding In Pattern -------------------------------------
254 pub fn add_amp_to_binding_in_pattern(x: u32) -> u32 {
262 #[rustc_clean(cfg="cfail2",
263 except="hir_owner_nodes,mir_built,optimized_mir,typeck_tables_of")]
264 #[rustc_clean(cfg="cfail3")]
265 pub fn add_amp_to_binding_in_pattern(x: u32) -> u32 {
274 // Change RHS Of Arm -----------------------------------------------------------
276 pub fn change_rhs_of_arm(x: u32) -> u32 {
285 #[rustc_clean(cfg="cfail2",
286 except="hir_owner_nodes,mir_built,optimized_mir")]
287 #[rustc_clean(cfg="cfail3")]
288 pub fn change_rhs_of_arm(x: u32) -> u32 {
298 // Add Alternative To Arm ------------------------------------------------------
300 pub fn add_alternative_to_arm(x: u32) -> u32 {
309 #[rustc_clean(cfg="cfail2",
310 except="hir_owner_nodes,mir_built,optimized_mir,typeck_tables_of")]
311 #[rustc_clean(cfg="cfail3")]
312 pub fn add_alternative_to_arm(x: u32) -> u32 {