]>
git.proxmox.com Git - rustc.git/blob - src/test/incremental/hashes/let_expressions.rs
1 // This test case tests the incremental compilation hash (ICH) implementation
2 // for let 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 // Change Name -----------------------------------------------------------------
19 pub fn change_name() {
24 #[rustc_clean(cfg="cfail2",
25 except
="HirBody,mir_built,optimized_mir")]
26 #[rustc_clean(cfg="cfail3")]
27 pub fn change_name() {
33 // Add Type --------------------------------------------------------------------
40 #[rustc_clean(cfg="cfail2",
41 except
="HirBody,typeck_tables_of,mir_built,optimized_mir")]
42 #[rustc_clean(cfg="cfail3")]
49 // Change Type -----------------------------------------------------------------
51 pub fn change_type() {
56 #[rustc_clean(cfg="cfail2",
57 except
="HirBody,typeck_tables_of,mir_built,optimized_mir")]
58 #[rustc_clean(cfg="cfail3")]
59 pub fn change_type() {
65 // Change Mutability of Reference Type -----------------------------------------
67 pub fn change_mutability_of_reference_type() {
72 #[rustc_clean(cfg="cfail2",
73 except
="HirBody,typeck_tables_of,mir_built,optimized_mir")]
74 #[rustc_clean(cfg="cfail3")]
75 pub fn change_mutability_of_reference_type() {
81 // Change Mutability of Slot ---------------------------------------------------
83 pub fn change_mutability_of_slot() {
88 #[rustc_clean(cfg="cfail2",
89 except
="HirBody,typeck_tables_of,mir_built,optimized_mir")]
90 #[rustc_clean(cfg="cfail3")]
91 pub fn change_mutability_of_slot() {
97 // Change Simple Binding to Pattern --------------------------------------------
99 pub fn change_simple_binding_to_pattern() {
104 #[rustc_clean(cfg="cfail2",
105 except
="HirBody,typeck_tables_of,mir_built,optimized_mir")]
106 #[rustc_clean(cfg="cfail3")]
107 pub fn change_simple_binding_to_pattern() {
108 let (_a
, _b
) = (0u8, 'x'
);
113 // Change Name in Pattern ------------------------------------------------------
115 pub fn change_name_in_pattern() {
116 let (_a
, _b
) = (1u8, 'y'
);
120 #[rustc_clean(cfg="cfail2",
121 except
="HirBody,mir_built,optimized_mir")]
122 #[rustc_clean(cfg="cfail3")]
123 pub fn change_name_in_pattern() {
124 let (_a
, _c
) = (1u8, 'y'
);
129 // Add `ref` in Pattern --------------------------------------------------------
131 pub fn add_ref_in_pattern() {
132 let (_a
, _b
) = (1u8, 'y'
);
136 #[rustc_clean(cfg="cfail2",
137 except
="HirBody,typeck_tables_of,mir_built,optimized_mir")]
138 #[rustc_clean(cfg="cfail3")]
139 pub fn add_ref_in_pattern() {
140 let (ref _a
, _b
) = (1u8, 'y'
);
145 // Add `&` in Pattern ----------------------------------------------------------
147 pub fn add_amp_in_pattern() {
148 let (_a
, _b
) = (&1u8, 'y'
);
152 #[rustc_clean(cfg="cfail2",
153 except
="HirBody,typeck_tables_of,mir_built,optimized_mir")]
154 #[rustc_clean(cfg="cfail3")]
155 pub fn add_amp_in_pattern() {
156 let (&_a
, _b
) = (&1u8, 'y'
);
161 // Change Mutability of Binding in Pattern -------------------------------------
163 pub fn change_mutability_of_binding_in_pattern() {
164 let (_a
, _b
) = (99u8, 'q'
);
168 #[rustc_clean(cfg="cfail2",
169 except
="HirBody,typeck_tables_of,mir_built,optimized_mir")]
170 #[rustc_clean(cfg="cfail3")]
171 pub fn change_mutability_of_binding_in_pattern() {
172 let (mut _a
, _b
) = (99u8, 'q'
);
177 // Add Initializer -------------------------------------------------------------
179 pub fn add_initializer() {
184 #[rustc_clean(cfg="cfail2",
185 except
="HirBody,typeck_tables_of,mir_built,optimized_mir")]
186 #[rustc_clean(cfg="cfail3")]
187 pub fn add_initializer() {
193 // Change Initializer ----------------------------------------------------------
195 pub fn change_initializer() {
200 #[rustc_clean(cfg="cfail2",
201 except
="HirBody,mir_built,optimized_mir")]
202 #[rustc_clean(cfg="cfail3")]
203 pub fn change_initializer() {