Skip to content

Commit 3b51a04

Browse files
committed
Convert legitimate failing errors to the new error format
1 parent 774c6da commit 3b51a04

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ pub fn eval_main<'a, 'tcx: 'a>(
249249
Ok(()) => {
250250
let leaks = ecx.memory().leak_report();
251251
if leaks != 0 {
252+
// TODO: Prevent leaks which aren't supposed to be there
252253
//tcx.sess.err("the evaluated program leaked memory");
253254
}
254255
}

tests/compile-fail/match_char.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
fn main() {
22
assert!(std::char::from_u32(-1_i32 as u32).is_none());
3-
match unsafe { std::mem::transmute::<i32, char>(-1) } { //~ERROR tried to interpret an invalid 32-bit value as a char: 4294967295
3+
match unsafe { std::mem::transmute::<i32, char>(-1) } { //~ ERROR constant evaluation error [E0080]
4+
//~^ NOTE tried to interpret an invalid 32-bit value as a char: 4294967295
45
'a' => {},
56
'b' => {},
67
_ => {},

tests/compile-fail/overflowing-rsh-2.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212

1313
fn main() {
1414
// Make sure we catch overflows that would be hidden by first casting the RHS to u32
15-
let _n = 1i64 >> (u32::max_value() as i64 + 1); //~ Overflow(Shr)
15+
let _n = 1i64 >> (u32::max_value() as i64 + 1); //~ ERROR constant evaluation error [E0080]
16+
//~^ NOTE suiriuruihrihue
1617
}

tests/compile-fail/repeat.rs

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/compile-fail/static_memory_modification.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ static X: usize = 5;
33
#[allow(mutable_transmutes)]
44
fn main() {
55
unsafe {
6-
*std::mem::transmute::<&usize, &mut usize>(&X) = 6; //~ ERROR: tried to modify constant memory
6+
*std::mem::transmute::<&usize, &mut usize>(&X) = 6; //~ ERROR constant evaluation error [E0080]
7+
//~^ NOTE tried to modify constant memory
78
assert_eq!(X, 6);
89
}
910
}

0 commit comments

Comments
 (0)