]>
git.proxmox.com Git - rustc.git/blob - tests/incremental/hashes/while_let_loops.rs
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.
8 // build-pass (FIXME(62277): could be check-pass?)
9 // revisions: cfail1 cfail2 cfail3 cfail4 cfail5 cfail6
10 // compile-flags: -Z query-dep-graph -O
11 // [cfail1]compile-flags: -Zincremental-ignore-spans
12 // [cfail2]compile-flags: -Zincremental-ignore-spans
13 // [cfail3]compile-flags: -Zincremental-ignore-spans
16 #![feature(rustc_attrs)]
21 #[cfg(any(cfail1,cfail4))]
22 pub fn change_loop_body() {
24 while let Some(0u32) = None
{
30 #[cfg(not(any(cfail1,cfail4)))]
31 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
32 #[rustc_clean(cfg="cfail3")]
33 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes")]
34 #[rustc_clean(cfg="cfail6")]
35 pub fn change_loop_body() {
37 while let Some(0u32) = None
{
46 #[cfg(any(cfail1,cfail4))]
47 pub fn change_loop_condition() {
49 while let Some(0u32) = None
{
55 #[cfg(not(any(cfail1,cfail4)))]
56 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
57 #[rustc_clean(cfg="cfail3")]
58 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes")]
59 #[rustc_clean(cfg="cfail6")]
60 pub fn change_loop_condition() {
62 while let Some(1u32) = None
{
71 #[cfg(any(cfail1,cfail4))]
74 while let Some(0u32) = None
{
80 #[cfg(not(any(cfail1,cfail4)))]
81 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes, typeck")]
82 #[rustc_clean(cfg="cfail3")]
83 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes, typeck")]
84 #[rustc_clean(cfg="cfail6")]
87 while let Some(0u32) = None
{
96 #[cfg(any(cfail1,cfail4))]
97 pub fn add_loop_label() {
99 while let Some(0u32) = None
{
105 #[cfg(not(any(cfail1,cfail4)))]
106 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
107 #[rustc_clean(cfg="cfail3")]
108 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes")]
109 #[rustc_clean(cfg="cfail6")]
110 pub fn add_loop_label() {
112 'label
: while let Some(0u32) = None
{
120 // Add loop label to break
121 #[cfg(any(cfail1,cfail4))]
122 pub fn add_loop_label_to_break() {
124 'label
: while let Some(0u32) = None
{
130 #[cfg(not(any(cfail1,cfail4)))]
131 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
132 #[rustc_clean(cfg="cfail3")]
133 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes")]
134 #[rustc_clean(cfg="cfail6")]
135 pub fn add_loop_label_to_break() {
137 'label
: while let Some(0u32) = None
{
145 // Change break label
146 #[cfg(any(cfail1,cfail4))]
147 pub fn change_break_label() {
149 'outer
: while let Some(0u32) = None
{
150 'inner
: while let Some(0u32) = None
{
157 #[cfg(not(any(cfail1,cfail4)))]
158 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
159 #[rustc_clean(cfg="cfail3")]
160 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes")]
161 #[rustc_clean(cfg="cfail6")]
162 pub fn change_break_label() {
164 'outer
: while let Some(0u32) = None
{
165 'inner
: while let Some(0u32) = None
{
172 // Add loop label to continue
173 #[cfg(any(cfail1,cfail4))]
174 pub fn add_loop_label_to_continue() {
176 'label
: while let Some(0u32) = None
{
182 #[cfg(not(any(cfail1,cfail4)))]
183 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
184 #[rustc_clean(cfg="cfail3")]
185 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes")]
186 #[rustc_clean(cfg="cfail6")]
187 pub fn add_loop_label_to_continue() {
189 'label
: while let Some(0u32) = None
{
197 // Change continue label
198 #[cfg(any(cfail1,cfail4))]
199 pub fn change_continue_label() {
201 'outer
: while let Some(0u32) = None
{
202 'inner
: while let Some(0u32) = None
{
209 #[cfg(not(any(cfail1,cfail4)))]
210 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
211 #[rustc_clean(cfg="cfail3")]
212 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes")]
213 #[rustc_clean(cfg="cfail6")]
214 pub fn change_continue_label() {
216 'outer
: while let Some(0u32) = None
{
217 'inner
: while let Some(0u32) = None
{
226 // Change continue to break
227 #[cfg(any(cfail1,cfail4))]
228 pub fn change_continue_to_break() {
230 while let Some(0u32) = None
{
236 #[cfg(not(any(cfail1,cfail4)))]
237 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes")]
238 #[rustc_clean(cfg="cfail3")]
239 #[rustc_clean(cfg="cfail5", except="hir_owner_nodes")]
240 #[rustc_clean(cfg="cfail6")]
241 pub fn change_continue_to_break() {
243 while let Some(0u32) = None
{