Skip to content

Update fingerprint tests macros #46523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 24 additions & 36 deletions src/test/incremental/hashes/closure_expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,34 +27,30 @@

// Change closure body ---------------------------------------------------------
#[cfg(cfail1)]
fn change_closure_body() {
pub fn change_closure_body() {
let _ = || 1u32;
}

#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
fn change_closure_body() {
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail3")]
pub fn change_closure_body() {
let _ = || 3u32;
}



// Add parameter ---------------------------------------------------------------
#[cfg(cfail1)]
fn add_parameter() {
pub fn add_parameter() {
let x = 0u32;
let _ = || x + 1;
}

#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
fn add_parameter() {
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn add_parameter() {
let x = 0u32;
let _ = |x: u32| x + 1;
}
Expand All @@ -63,51 +59,45 @@ fn add_parameter() {

// Change parameter pattern ----------------------------------------------------
#[cfg(cfail1)]
fn change_parameter_pattern() {
pub fn change_parameter_pattern() {
let _ = |x: &u32| x;
}

#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
fn change_parameter_pattern() {
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_parameter_pattern() {
let _ = |&x: &u32| x;
}



// Add `move` to closure -------------------------------------------------------
#[cfg(cfail1)]
fn add_move() {
pub fn add_move() {
let _ = || 1;
}

#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
fn add_move() {
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail3")]
pub fn add_move() {
let _ = move || 1;
}



// Add type ascription to parameter --------------------------------------------
#[cfg(cfail1)]
fn add_type_ascription_to_parameter() {
pub fn add_type_ascription_to_parameter() {
let closure = |x| x + 1u32;
let _: u32 = closure(1);
}

#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
fn add_type_ascription_to_parameter() {
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail3")]
pub fn add_type_ascription_to_parameter() {
let closure = |x: u32| x + 1u32;
let _: u32 = closure(1);
}
Expand All @@ -116,17 +106,15 @@ fn add_type_ascription_to_parameter() {

// Change parameter type -------------------------------------------------------
#[cfg(cfail1)]
fn change_parameter_type() {
pub fn change_parameter_type() {
let closure = |x: u32| (x as u64) + 1;
let _ = closure(1);
}

#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
fn change_parameter_type() {
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_parameter_type() {
let closure = |x: u16| (x as u64) + 1;
let _ = closure(1);
}
110 changes: 44 additions & 66 deletions src/test/incremental/hashes/for_loops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

// Change loop body ------------------------------------------------------------
#[cfg(cfail1)]
fn change_loop_body() {
pub fn change_loop_body() {
let mut _x = 0;
for _ in 0..1 {
_x = 1;
Expand All @@ -36,11 +36,9 @@ fn change_loop_body() {
}

#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
fn change_loop_body() {
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_loop_body() {
let mut _x = 0;
for _ in 0..1 {
_x = 2;
Expand All @@ -52,7 +50,7 @@ fn change_loop_body() {

// Change iteration variable name ----------------------------------------------
#[cfg(cfail1)]
fn change_iteration_variable_name() {
pub fn change_iteration_variable_name() {
let mut _x = 0;
for _i in 0..1 {
_x = 1;
Expand All @@ -61,11 +59,9 @@ fn change_iteration_variable_name() {
}

#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
fn change_iteration_variable_name() {
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_iteration_variable_name() {
let mut _x = 0;
for _a in 0..1 {
_x = 1;
Expand All @@ -77,7 +73,7 @@ fn change_iteration_variable_name() {

// Change iteration variable pattern -------------------------------------------
#[cfg(cfail1)]
fn change_iteration_variable_pattern() {
pub fn change_iteration_variable_pattern() {
let mut _x = 0;
for _i in &[0, 1, 2] {
_x = 1;
Expand All @@ -86,11 +82,9 @@ fn change_iteration_variable_pattern() {
}

#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
fn change_iteration_variable_pattern() {
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn change_iteration_variable_pattern() {
let mut _x = 0;
for &_i in &[0, 1, 2] {
_x = 1;
Expand All @@ -102,7 +96,7 @@ fn change_iteration_variable_pattern() {

// Change iterable -------------------------------------------------------------
#[cfg(cfail1)]
fn change_iterable() {
pub fn change_iterable() {
let mut _x = 0;
for _ in &[0, 1, 2] {
_x = 1;
Expand All @@ -111,11 +105,9 @@ fn change_iterable() {
}

#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
fn change_iterable() {
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_iterable() {
let mut _x = 0;
for _ in &[0, 1, 3] {
_x = 1;
Expand All @@ -127,19 +119,17 @@ fn change_iterable() {

// Add break -------------------------------------------------------------------
#[cfg(cfail1)]
fn add_break() {
pub fn add_break() {
let mut _x = 0;
for _ in 0..1 {
_x = 1;
}
}

#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
fn add_break() {
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized, TypeckTables")]
#[rustc_clean(cfg="cfail3")]
pub fn add_break() {
let mut _x = 0;
for _ in 0..1 {
_x = 1;
Expand All @@ -151,7 +141,7 @@ fn add_break() {

// Add loop label --------------------------------------------------------------
#[cfg(cfail1)]
fn add_loop_label() {
pub fn add_loop_label() {
let mut _x = 0;
for _ in 0..1 {
_x = 1;
Expand All @@ -160,11 +150,9 @@ fn add_loop_label() {
}

#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
fn add_loop_label() {
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail3")]
pub fn add_loop_label() {
let mut _x = 0;
'label: for _ in 0..1 {
_x = 1;
Expand All @@ -176,7 +164,7 @@ fn add_loop_label() {

// Add loop label to break -----------------------------------------------------
#[cfg(cfail1)]
fn add_loop_label_to_break() {
pub fn add_loop_label_to_break() {
let mut _x = 0;
'label: for _ in 0..1 {
_x = 1;
Expand All @@ -185,11 +173,9 @@ fn add_loop_label_to_break() {
}

#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
fn add_loop_label_to_break() {
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail3")]
pub fn add_loop_label_to_break() {
let mut _x = 0;
'label: for _ in 0..1 {
_x = 1;
Expand All @@ -201,7 +187,7 @@ fn add_loop_label_to_break() {

// Change break label ----------------------------------------------------------
#[cfg(cfail1)]
fn change_break_label() {
pub fn change_break_label() {
let mut _x = 0;
'outer: for _ in 0..1 {
'inner: for _ in 0..1 {
Expand All @@ -212,11 +198,9 @@ fn change_break_label() {
}

#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
fn change_break_label() {
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_break_label() {
let mut _x = 0;
'outer: for _ in 0..1 {
'inner: for _ in 0..1 {
Expand All @@ -230,7 +214,7 @@ fn change_break_label() {

// Add loop label to continue --------------------------------------------------
#[cfg(cfail1)]
fn add_loop_label_to_continue() {
pub fn add_loop_label_to_continue() {
let mut _x = 0;
'label: for _ in 0..1 {
_x = 1;
Expand All @@ -239,11 +223,9 @@ fn add_loop_label_to_continue() {
}

#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
fn add_loop_label_to_continue() {
#[rustc_clean(cfg="cfail2", except="HirBody")]
#[rustc_clean(cfg="cfail3")]
pub fn add_loop_label_to_continue() {
let mut _x = 0;
'label: for _ in 0..1 {
_x = 1;
Expand All @@ -255,7 +237,7 @@ fn add_loop_label_to_continue() {

// Change continue label ----------------------------------------------------------
#[cfg(cfail1)]
fn change_continue_label() {
pub fn change_continue_label() {
let mut _x = 0;
'outer: for _ in 0..1 {
'inner: for _ in 0..1 {
Expand All @@ -266,11 +248,9 @@ fn change_continue_label() {
}

#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
fn change_continue_label() {
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_label() {
let mut _x = 0;
'outer: for _ in 0..1 {
'inner: for _ in 0..1 {
Expand All @@ -284,7 +264,7 @@ fn change_continue_label() {

// Change continue to break ----------------------------------------------------
#[cfg(cfail1)]
fn change_continue_to_break() {
pub fn change_continue_to_break() {
let mut _x = 0;
for _ in 0..1 {
_x = 1;
Expand All @@ -293,11 +273,9 @@ fn change_continue_to_break() {
}

#[cfg(not(cfail1))]
#[rustc_clean(label="Hir", cfg="cfail2")]
#[rustc_clean(label="Hir", cfg="cfail3")]
#[rustc_dirty(label="HirBody", cfg="cfail2")]
#[rustc_clean(label="HirBody", cfg="cfail3")]
fn change_continue_to_break() {
#[rustc_clean(cfg="cfail2", except="HirBody, MirValidated, MirOptimized")]
#[rustc_clean(cfg="cfail3")]
pub fn change_continue_to_break() {
let mut _x = 0;
for _ in 0..1 {
_x = 1;
Expand Down
Loading