]>
git.proxmox.com Git - rustc.git/blob - src/test/incremental/hashes/if_expressions.rs
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
14 #![feature(rustc_attrs)]
17 // Change condition (if)
19 pub fn change_condition(x
: bool
) -> u32 {
28 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
29 #[rustc_clean(cfg="cfail3")]
30 pub fn change_condition(x
: bool
) -> u32 {
38 // Change then branch (if)
40 pub fn change_then_branch(x
: bool
) -> u32 {
49 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir")]
50 #[rustc_clean(cfg="cfail3")]
51 pub fn change_then_branch(x
: bool
) -> u32 {
61 // Change else branch (if)
63 pub fn change_else_branch(x
: bool
) -> u32 {
72 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir")]
73 #[rustc_clean(cfg="cfail3")]
74 pub fn change_else_branch(x
: bool
) -> u32 {
84 // Add else branch (if)
86 pub fn add_else_branch(x
: bool
) -> u32 {
97 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,typeck")]
98 #[rustc_clean(cfg="cfail3")]
99 pub fn add_else_branch(x
: bool
) -> u32 {
112 // Change condition (if let)
114 pub fn change_condition_if_let(x
: Option
<u32>) -> u32 {
115 if let Some(_x
) = x
{
123 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
124 #[rustc_clean(cfg="cfail3")]
125 pub fn change_condition_if_let(x
: Option
<u32>) -> u32 {
135 // Change then branch (if let)
137 pub fn change_then_branch_if_let(x
: Option
<u32>) -> u32 {
146 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir,typeck")]
147 #[rustc_clean(cfg="cfail3")]
148 pub fn change_then_branch_if_let(x
: Option
<u32>) -> u32 {
158 // Change else branch (if let)
160 pub fn change_else_branch_if_let(x
: Option
<u32>) -> u32 {
169 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,optimized_mir")]
170 #[rustc_clean(cfg="cfail3")]
171 pub fn change_else_branch_if_let(x
: Option
<u32>) -> u32 {
181 // Add else branch (if let)
183 pub fn add_else_branch_if_let(x
: Option
<u32>) -> u32 {
194 #[rustc_clean(cfg="cfail2", except="hir_owner_nodes,typeck")]
195 #[rustc_clean(cfg="cfail3")]
196 pub fn add_else_branch_if_let(x
: Option
<u32>) -> u32 {