Skip to content

Commit 77aee18

Browse files
committed
Update closure expression fingerprint hash tests
1 parent 8503b3f commit 77aee18

File tree

1 file changed

+24
-36
lines changed

1 file changed

+24
-36
lines changed

src/test/incremental/hashes/closure_expressions.rs

Lines changed: 24 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,30 @@
2727

2828
// Change closure body ---------------------------------------------------------
2929
#[cfg(cfail1)]
30-
fn change_closure_body() {
30+
pub fn change_closure_body() {
3131
let _ = || 1u32;
3232
}
3333

3434
#[cfg(not(cfail1))]
35-
#[rustc_clean(label="Hir", cfg="cfail2")]
36-
#[rustc_clean(label="Hir", cfg="cfail3")]
37-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
38-
#[rustc_clean(label="HirBody", cfg="cfail3")]
39-
fn change_closure_body() {
35+
#[rustc_clean(cfg="cfail2", except="HirBody")]
36+
#[rustc_clean(cfg="cfail3")]
37+
pub fn change_closure_body() {
4038
let _ = || 3u32;
4139
}
4240

4341

4442

4543
// Add parameter ---------------------------------------------------------------
4644
#[cfg(cfail1)]
47-
fn add_parameter() {
45+
pub fn add_parameter() {
4846
let x = 0u32;
4947
let _ = || x + 1;
5048
}
5149

5250
#[cfg(not(cfail1))]
53-
#[rustc_clean(label="Hir", cfg="cfail2")]
54-
#[rustc_clean(label="Hir", cfg="cfail3")]
55-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
56-
#[rustc_clean(label="HirBody", cfg="cfail3")]
57-
fn add_parameter() {
51+
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
52+
#[rustc_clean(cfg="cfail3")]
53+
pub fn add_parameter() {
5854
let x = 0u32;
5955
let _ = |x: u32| x + 1;
6056
}
@@ -63,51 +59,45 @@ fn add_parameter() {
6359

6460
// Change parameter pattern ----------------------------------------------------
6561
#[cfg(cfail1)]
66-
fn change_parameter_pattern() {
62+
pub fn change_parameter_pattern() {
6763
let _ = |x: &u32| x;
6864
}
6965

7066
#[cfg(not(cfail1))]
71-
#[rustc_clean(label="Hir", cfg="cfail2")]
72-
#[rustc_clean(label="Hir", cfg="cfail3")]
73-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
74-
#[rustc_clean(label="HirBody", cfg="cfail3")]
75-
fn change_parameter_pattern() {
67+
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
68+
#[rustc_clean(cfg="cfail3")]
69+
pub fn change_parameter_pattern() {
7670
let _ = |&x: &u32| x;
7771
}
7872

7973

8074

8175
// Add `move` to closure -------------------------------------------------------
8276
#[cfg(cfail1)]
83-
fn add_move() {
77+
pub fn add_move() {
8478
let _ = || 1;
8579
}
8680

8781
#[cfg(not(cfail1))]
88-
#[rustc_clean(label="Hir", cfg="cfail2")]
89-
#[rustc_clean(label="Hir", cfg="cfail3")]
90-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
91-
#[rustc_clean(label="HirBody", cfg="cfail3")]
92-
fn add_move() {
82+
#[rustc_clean(cfg="cfail2", except="HirBody")]
83+
#[rustc_clean(cfg="cfail3")]
84+
pub fn add_move() {
9385
let _ = move || 1;
9486
}
9587

9688

9789

9890
// Add type ascription to parameter --------------------------------------------
9991
#[cfg(cfail1)]
100-
fn add_type_ascription_to_parameter() {
92+
pub fn add_type_ascription_to_parameter() {
10193
let closure = |x| x + 1u32;
10294
let _: u32 = closure(1);
10395
}
10496

10597
#[cfg(not(cfail1))]
106-
#[rustc_clean(label="Hir", cfg="cfail2")]
107-
#[rustc_clean(label="Hir", cfg="cfail3")]
108-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
109-
#[rustc_clean(label="HirBody", cfg="cfail3")]
110-
fn add_type_ascription_to_parameter() {
98+
#[rustc_clean(cfg="cfail2", except="HirBody")]
99+
#[rustc_clean(cfg="cfail3")]
100+
pub fn add_type_ascription_to_parameter() {
111101
let closure = |x: u32| x + 1u32;
112102
let _: u32 = closure(1);
113103
}
@@ -116,17 +106,15 @@ fn add_type_ascription_to_parameter() {
116106

117107
// Change parameter type -------------------------------------------------------
118108
#[cfg(cfail1)]
119-
fn change_parameter_type() {
109+
pub fn change_parameter_type() {
120110
let closure = |x: u32| (x as u64) + 1;
121111
let _ = closure(1);
122112
}
123113

124114
#[cfg(not(cfail1))]
125-
#[rustc_clean(label="Hir", cfg="cfail2")]
126-
#[rustc_clean(label="Hir", cfg="cfail3")]
127-
#[rustc_dirty(label="HirBody", cfg="cfail2")]
128-
#[rustc_clean(label="HirBody", cfg="cfail3")]
129-
fn change_parameter_type() {
115+
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
116+
#[rustc_clean(cfg="cfail3")]
117+
pub fn change_parameter_type() {
130118
let closure = |x: u16| (x as u64) + 1;
131119
let _ = closure(1);
132120
}

0 commit comments

Comments
 (0)