1 // This test case tests the incremental compilation hash (ICH) implementation
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
13 #![feature(rustc_attrs)]
17 // Change loop body ------------------------------------------------------------
19 pub fn change_loop_body() {
28 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir")]
29 #[rustc_clean(cfg="cfail3")]
30 pub fn change_loop_body() {
40 // Change iteration variable name ----------------------------------------------
42 pub fn change_iteration_variable_name() {
51 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir")]
52 #[rustc_clean(cfg="cfail3")]
53 pub fn change_iteration_variable_name() {
63 // Change iteration variable pattern -------------------------------------------
65 pub fn change_iteration_variable_pattern() {
67 for _i in &[0, 1, 2] {
74 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir, typeck")]
75 #[rustc_clean(cfg="cfail3")]
76 pub fn change_iteration_variable_pattern() {
78 for &_i in &[0, 1, 2] {
86 // Change iterable -------------------------------------------------------------
88 pub fn change_iterable() {
97 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, promoted_mir")]
98 #[rustc_clean(cfg="cfail3")]
99 pub fn change_iterable() {
101 for _ in &[0, 1, 3] {
109 // Add break -------------------------------------------------------------------
119 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir, typeck")]
120 #[rustc_clean(cfg="cfail3")]
131 // Add loop label --------------------------------------------------------------
133 pub fn add_loop_label() {
142 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
143 #[rustc_clean(cfg="cfail3")]
144 pub fn add_loop_label() {
146 'label: for _ in 0..1 {
154 // Add loop label to break -----------------------------------------------------
156 pub fn add_loop_label_to_break() {
158 'label: for _ in 0..1 {
165 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
166 #[rustc_clean(cfg="cfail3")]
167 pub fn add_loop_label_to_break() {
169 'label: for _ in 0..1 {
177 // Change break label ----------------------------------------------------------
179 pub fn change_break_label() {
181 'outer: for _ in 0..1 {
182 'inner: for _ in 0..1 {
190 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir")]
191 #[rustc_clean(cfg="cfail3")]
192 pub fn change_break_label() {
194 'outer: for _ in 0..1 {
195 'inner: for _ in 0..1 {
204 // Add loop label to continue --------------------------------------------------
206 pub fn add_loop_label_to_continue() {
208 'label: for _ in 0..1 {
215 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
216 #[rustc_clean(cfg="cfail3")]
217 pub fn add_loop_label_to_continue() {
219 'label: for _ in 0..1 {
227 // Change continue label ----------------------------------------------------------
229 pub fn change_continue_label() {
231 'outer: for _ in 0..1 {
232 'inner: for _ in 0..1 {
240 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir")]
241 #[rustc_clean(cfg="cfail3")]
242 pub fn change_continue_label() {
244 'outer: for _ in 0..1 {
245 'inner: for _ in 0..1 {
254 // Change continue to break ----------------------------------------------------
256 pub fn change_continue_to_break() {
265 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, optimized_mir")]
266 #[rustc_clean(cfg="cfail3")]
267 pub fn change_continue_to_break() {