Skip to content

Commit 1a704a5

Browse files
committed
rustup, adjust error messages
1 parent 6c4be68 commit 1a704a5

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
fb5615a4771ea3d54256f969dc84d2dfd38d812c
1+
e94eaa6dce468928b4e1326b2f0054f3075681ff

tests/compile-fail/validity/execute_memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
fn main() {
44
let x = box 42;
55
unsafe {
6-
let _f = std::mem::transmute::<Box<i32>, fn()>(x); //~ ERROR encountered a pointer, but expected a function pointer
6+
let _f = std::mem::transmute::<Box<i32>, fn()>(x); //~ ERROR expected a function pointer
77
}
88
}

tests/compile-fail/validity/fn_ptr_offset.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ fn main() {
66
let x : fn() = f;
77
let y : *mut u8 = unsafe { mem::transmute(x) };
88
let y = y.wrapping_offset(1);
9-
let _x : fn() = unsafe { mem::transmute(y) }; //~ ERROR encountered a pointer, but expected a function pointer
9+
let _x : fn() = unsafe { mem::transmute(y) }; //~ ERROR expected a function pointer
1010
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
fn main() {
2-
let _b = unsafe { std::mem::transmute::<u8, bool>(2) }; //~ ERROR encountered 2, but expected a boolean
2+
let _b = unsafe { std::mem::transmute::<u8, bool>(2) }; //~ ERROR encountered 0x02, but expected a boolean
33
}

tests/compile-fail/validity/invalid_char.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn main() {
22
assert!(std::char::from_u32(-1_i32 as u32).is_none());
3-
let _val = match unsafe { std::mem::transmute::<i32, char>(-1) } { //~ ERROR encountered 4294967295, but expected a valid unicode codepoint
3+
let _val = match unsafe { std::mem::transmute::<i32, char>(-1) } { //~ ERROR encountered 0xffffffff, but expected a valid unicode codepoint
44
'a' => {true},
55
'b' => {false},
66
_ => {true},

tests/compile-fail/validity/invalid_enum_discriminant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ pub enum Foo {
44
}
55

66
fn main() {
7-
let _f = unsafe { std::mem::transmute::<i32, Foo>(42) }; //~ ERROR encountered 42, but expected a valid enum discriminant
7+
let _f = unsafe { std::mem::transmute::<i32, Foo>(42) }; //~ ERROR encountered 0x0000002a, but expected a valid enum discriminant
88
}

tests/compile-fail/validity/transmute_through_ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ fn main() {
1010
let mut x = Bool::True;
1111
evil(&mut x);
1212
let _y = x; // reading this ought to be enough to trigger validation
13-
//~^ ERROR encountered 44, but expected a valid enum discriminant
13+
//~^ ERROR encountered 0x0000002c, but expected a valid enum discriminant
1414
}

0 commit comments

Comments
 (0)