diff options
| author | Michael Woerister <michaelwoerister@posteo> | 2017-10-26 16:21:37 +0200 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo> | 2017-10-26 16:23:31 +0200 |
| commit | 10ffff8bc6f073ffe1342ca3fef229cec0d98693 (patch) | |
| tree | 9ebd2815a6ee0a1412dfd8452c518f6c3171c6cc /src/test/incremental/hashes | |
| parent | eea916068cc0d0d5d39fc4b02c2c4c88ae9a9138 (diff) | |
| download | rust-10ffff8bc6f073ffe1342ca3fef229cec0d98693.tar.gz rust-10ffff8bc6f073ffe1342ca3fef229cec0d98693.zip | |
incr.comp.: Update overflow-check logic in HIR hashing.
Diffstat (limited to 'src/test/incremental/hashes')
| -rw-r--r-- | src/test/incremental/hashes/consts.rs | 46 | ||||
| -rw-r--r-- | src/test/incremental/hashes/statics.rs | 46 |
2 files changed, 52 insertions, 40 deletions
diff --git a/src/test/incremental/hashes/consts.rs b/src/test/incremental/hashes/consts.rs index 35641e978b7..65acfb82da6 100644 --- a/src/test/incremental/hashes/consts.rs +++ b/src/test/incremental/hashes/consts.rs @@ -62,48 +62,54 @@ const CONST_CHANGE_TYPE_2: Option<u64> = None; // Change value between simple literals --------------------------------------- -#[cfg(cfail1)] -const CONST_CHANGE_VALUE_1: i16 = 1; - -#[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", except="HirBody")] #[rustc_clean(cfg="cfail3")] #[rustc_metadata_clean(cfg="cfail3")] -const CONST_CHANGE_VALUE_1: i16 = 2; +const CONST_CHANGE_VALUE_1: i16 = { + #[cfg(cfail1)] + { 1 } + #[cfg(not(cfail1))] + { 2 } +}; -// Change value between expressions ------------------------------------------- -#[cfg(cfail1)] -const CONST_CHANGE_VALUE_2: i16 = 1 + 1; -#[cfg(not(cfail1))] +// Change value between expressions ------------------------------------------- #[rustc_clean(cfg="cfail2", except="HirBody")] #[rustc_clean(cfg="cfail3")] #[rustc_metadata_dirty(cfg="cfail2")] #[rustc_metadata_clean(cfg="cfail3")] -const CONST_CHANGE_VALUE_2: i16 = 1 + 2; - +const CONST_CHANGE_VALUE_2: i16 = { + #[cfg(cfail1)] + { 1 + 1 } -#[cfg(cfail1)] -const CONST_CHANGE_VALUE_3: i16 = 2 + 3; + #[cfg(not(cfail1))] + { 1 + 2 } +}; -#[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", except="HirBody")] #[rustc_clean(cfg="cfail3")] #[rustc_metadata_dirty(cfg="cfail2")] #[rustc_metadata_clean(cfg="cfail3")] -const CONST_CHANGE_VALUE_3: i16 = 2 * 3; - +const CONST_CHANGE_VALUE_3: i16 = { + #[cfg(cfail1)] + { 2 + 3 } -#[cfg(cfail1)] -const CONST_CHANGE_VALUE_4: i16 = 1 + 2 * 3; + #[cfg(not(cfail1))] + { 2 * 3 } +}; -#[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", except="HirBody")] #[rustc_clean(cfg="cfail3")] #[rustc_metadata_dirty(cfg="cfail2")] #[rustc_metadata_clean(cfg="cfail3")] -const CONST_CHANGE_VALUE_4: i16 = 1 + 2 * 4; +const CONST_CHANGE_VALUE_4: i16 = { + #[cfg(cfail1)] + { 1 + 2 * 3 } + + #[cfg(not(cfail1))] + { 1 + 2 * 4 } +}; // Change type indirectly ----------------------------------------------------- diff --git a/src/test/incremental/hashes/statics.rs b/src/test/incremental/hashes/statics.rs index 4ff80ead89d..7a4123190dd 100644 --- a/src/test/incremental/hashes/statics.rs +++ b/src/test/incremental/hashes/statics.rs @@ -115,49 +115,55 @@ static STATIC_CHANGE_TYPE_2: Option<u16> = None; // Change value between simple literals --------------------------------------- -#[cfg(cfail1)] -static STATIC_CHANGE_VALUE_1: i16 = 1; - -#[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", except="HirBody")] #[rustc_clean(cfg="cfail3")] #[rustc_metadata_clean(cfg="cfail2")] #[rustc_metadata_clean(cfg="cfail3")] -static STATIC_CHANGE_VALUE_1: i16 = 2; +static STATIC_CHANGE_VALUE_1: i16 = { + #[cfg(cfail1)] + { 1 } + #[cfg(not(cfail1))] + { 2 } +}; -// Change value between expressions ------------------------------------------- -#[cfg(cfail1)] -static STATIC_CHANGE_VALUE_2: i16 = 1 + 1; -#[cfg(not(cfail1))] +// Change value between expressions ------------------------------------------- #[rustc_clean(cfg="cfail2", except="HirBody")] #[rustc_clean(cfg="cfail3")] #[rustc_metadata_clean(cfg="cfail2")] #[rustc_metadata_clean(cfg="cfail3")] -static STATIC_CHANGE_VALUE_2: i16 = 1 + 2; - +static STATIC_CHANGE_VALUE_2: i16 = { + #[cfg(cfail1)] + { 1 + 1 } -#[cfg(cfail1)] -static STATIC_CHANGE_VALUE_3: i16 = 2 + 3; + #[cfg(not(cfail1))] + { 1 + 2 } +}; -#[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", except="HirBody")] #[rustc_clean(cfg="cfail3")] #[rustc_metadata_clean(cfg="cfail2")] #[rustc_metadata_clean(cfg="cfail3")] -static STATIC_CHANGE_VALUE_3: i16 = 2 * 3; - +static STATIC_CHANGE_VALUE_3: i16 = { + #[cfg(cfail1)] + { 2 + 3 } -#[cfg(cfail1)] -static STATIC_CHANGE_VALUE_4: i16 = 1 + 2 * 3; + #[cfg(not(cfail1))] + { 2 * 3 } +}; -#[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2", except="HirBody")] #[rustc_clean(cfg="cfail3")] #[rustc_metadata_clean(cfg="cfail2")] #[rustc_metadata_clean(cfg="cfail3")] -static STATIC_CHANGE_VALUE_4: i16 = 1 + 2 * 4; +static STATIC_CHANGE_VALUE_4: i16 = { + #[cfg(cfail1)] + { 1 + 2 * 3 } + + #[cfg(not(cfail1))] + { 1 + 2 * 4 } +}; // Change type indirectly ----------------------------------------------------- |
