incr.comp.: Update overflow-check logic in HIR hashing.
This commit is contained in:
parent
eea916068c
commit
10ffff8bc6
5 changed files with 110 additions and 49 deletions
|
|
@ -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))]
|
||||
#[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(not(cfail1))]
|
||||
{ 1 + 2 }
|
||||
};
|
||||
|
||||
#[cfg(cfail1)]
|
||||
const CONST_CHANGE_VALUE_3: i16 = 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_3: i16 = 2 * 3;
|
||||
const CONST_CHANGE_VALUE_3: i16 = {
|
||||
#[cfg(cfail1)]
|
||||
{ 2 + 3 }
|
||||
|
||||
#[cfg(not(cfail1))]
|
||||
{ 2 * 3 }
|
||||
};
|
||||
|
||||
#[cfg(cfail1)]
|
||||
const CONST_CHANGE_VALUE_4: i16 = 1 + 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 -----------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -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))]
|
||||
#[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(not(cfail1))]
|
||||
{ 1 + 2 }
|
||||
};
|
||||
|
||||
#[cfg(cfail1)]
|
||||
static STATIC_CHANGE_VALUE_3: i16 = 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_3: i16 = 2 * 3;
|
||||
static STATIC_CHANGE_VALUE_3: i16 = {
|
||||
#[cfg(cfail1)]
|
||||
{ 2 + 3 }
|
||||
|
||||
#[cfg(not(cfail1))]
|
||||
{ 2 * 3 }
|
||||
};
|
||||
|
||||
#[cfg(cfail1)]
|
||||
static STATIC_CHANGE_VALUE_4: i16 = 1 + 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 -----------------------------------------------------
|
||||
|
|
|
|||
30
src/test/incremental/spans_significant_w_panic.rs
Normal file
30
src/test/incremental/spans_significant_w_panic.rs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// This test makes sure that just changing a definition's location in the
|
||||
// source file also changes its incr. comp. hash, if debuginfo is enabled.
|
||||
|
||||
// revisions:rpass1 rpass2
|
||||
|
||||
// compile-flags: -C overflow-checks=on
|
||||
|
||||
#![feature(rustc_attrs)]
|
||||
|
||||
#[cfg(rpass1)]
|
||||
pub fn main() {
|
||||
let _ = 0u8 + 1;
|
||||
}
|
||||
|
||||
#[cfg(rpass2)]
|
||||
#[rustc_clean(label="Hir", cfg="rpass2")]
|
||||
#[rustc_dirty(label="HirBody", cfg="rpass2")]
|
||||
pub fn main() {
|
||||
let _ = 0u8 + 1;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue