1 // This test case tests the incremental compilation hash (ICH) implementation
2 // for `while let` loops.
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.
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() {
21 while let Some(0u32) = None {
28 #[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
29 #[rustc_clean(cfg="cfail3")]
30 pub fn change_loop_body() {
32 while let Some(0u32) = None {
40 // Change loop body ------------------------------------------------------------
42 pub fn change_loop_condition() {
44 while let Some(0u32) = None {
51 #[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
52 #[rustc_clean(cfg="cfail3")]
53 pub fn change_loop_condition() {
55 while let Some(1u32) = None {
63 // Add break -------------------------------------------------------------------
67 while let Some(0u32) = None {
73 #[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized, TypeckTables")]
74 #[rustc_clean(cfg="cfail3")]
77 while let Some(0u32) = None {
85 // Add loop label --------------------------------------------------------------
87 pub fn add_loop_label() {
89 while let Some(0u32) = None {
96 #[rustc_clean(cfg="cfail2", except="HirBody")]
97 #[rustc_clean(cfg="cfail3")]
98 pub fn add_loop_label() {
100 'label: while let Some(0u32) = None {
108 // Add loop label to break -----------------------------------------------------
110 pub fn add_loop_label_to_break() {
112 'label: while let Some(0u32) = None {
119 #[rustc_clean(cfg="cfail2", except="HirBody")]
120 #[rustc_clean(cfg="cfail3")]
121 pub fn add_loop_label_to_break() {
123 'label: while let Some(0u32) = None {
131 // Change break label ----------------------------------------------------------
133 pub fn change_break_label() {
135 'outer: while let Some(0u32) = None {
136 'inner: while let Some(0u32) = None {
144 #[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized, TypeckTables")]
145 #[rustc_clean(cfg="cfail3")]
146 pub fn change_break_label() {
148 'outer: while let Some(0u32) = None {
149 'inner: while let Some(0u32) = None {
158 // Add loop label to continue --------------------------------------------------
160 pub fn add_loop_label_to_continue() {
162 'label: while let Some(0u32) = None {
169 #[rustc_clean(cfg="cfail2", except="HirBody")]
170 #[rustc_clean(cfg="cfail3")]
171 pub fn add_loop_label_to_continue() {
173 'label: while let Some(0u32) = None {
181 // Change continue label ----------------------------------------------------------
183 pub fn change_continue_label() {
185 'outer: while let Some(0u32) = None {
186 'inner: while let Some(0u32) = None {
194 #[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized, TypeckTables")]
195 #[rustc_clean(cfg="cfail3")]
196 pub fn change_continue_label() {
198 'outer: while let Some(0u32) = None {
199 'inner: while let Some(0u32) = None {
208 // Change continue to break ----------------------------------------------------
210 pub fn change_continue_to_break() {
212 while let Some(0u32) = None {
219 #[rustc_clean(cfg="cfail2", except="HirBody, MirBuilt, MirOptimized")]
220 #[rustc_clean(cfg="cfail3")]
221 pub fn change_continue_to_break() {
223 while let Some(0u32) = None {