Convert legitimate failing errors to the new error format
This commit is contained in:
@@ -249,6 +249,7 @@ pub fn eval_main<'a, 'tcx: 'a>(
|
|||||||
Ok(()) => {
|
Ok(()) => {
|
||||||
let leaks = ecx.memory().leak_report();
|
let leaks = ecx.memory().leak_report();
|
||||||
if leaks != 0 {
|
if leaks != 0 {
|
||||||
|
// TODO: Prevent leaks which aren't supposed to be there
|
||||||
//tcx.sess.err("the evaluated program leaked memory");
|
//tcx.sess.err("the evaluated program leaked memory");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
fn main() {
|
fn main() {
|
||||||
assert!(std::char::from_u32(-1_i32 as u32).is_none());
|
assert!(std::char::from_u32(-1_i32 as u32).is_none());
|
||||||
match unsafe { std::mem::transmute::<i32, char>(-1) } { //~ERROR tried to interpret an invalid 32-bit value as a char: 4294967295
|
match unsafe { std::mem::transmute::<i32, char>(-1) } { //~ ERROR constant evaluation error [E0080]
|
||||||
|
//~^ NOTE tried to interpret an invalid 32-bit value as a char: 4294967295
|
||||||
'a' => {},
|
'a' => {},
|
||||||
'b' => {},
|
'b' => {},
|
||||||
_ => {},
|
_ => {},
|
||||||
|
|||||||
@@ -12,5 +12,6 @@
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// Make sure we catch overflows that would be hidden by first casting the RHS to u32
|
// Make sure we catch overflows that would be hidden by first casting the RHS to u32
|
||||||
let _n = 1i64 >> (u32::max_value() as i64 + 1); //~ Overflow(Shr)
|
let _n = 1i64 >> (u32::max_value() as i64 + 1); //~ ERROR constant evaluation error [E0080]
|
||||||
|
//~^ NOTE suiriuruihrihue
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
// error-pattern the type `[u8;
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
let data: [u8; std::usize::MAX] = [42; std::usize::MAX];
|
|
||||||
assert_eq!(data.len(), 1024);
|
|
||||||
}
|
|
||||||
@@ -3,7 +3,8 @@ static X: usize = 5;
|
|||||||
#[allow(mutable_transmutes)]
|
#[allow(mutable_transmutes)]
|
||||||
fn main() {
|
fn main() {
|
||||||
unsafe {
|
unsafe {
|
||||||
*std::mem::transmute::<&usize, &mut usize>(&X) = 6; //~ ERROR: tried to modify constant memory
|
*std::mem::transmute::<&usize, &mut usize>(&X) = 6; //~ ERROR constant evaluation error [E0080]
|
||||||
|
//~^ NOTE tried to modify constant memory
|
||||||
assert_eq!(X, 6);
|
assert_eq!(X, 6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user