Skip to content

Commit

Permalink
rustup, and some final message adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Mar 19, 2020
1 parent e1e158e commit 49051e0
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
660326e9791d5caf3186b14521498c2584a494ab
57e1da59cd0761330b4ea8d47b16340a78eeafa9
4 changes: 2 additions & 2 deletions tests/compile-fail/cast_fn_ptr1.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
fn main() {
fn f() {}
fn f() {} //~ ERROR calling a function with more arguments than it expected

let g = unsafe {
std::mem::transmute::<fn(), fn(i32)>(f)
};

g(42) //~ ERROR calling a function with more arguments than it expected
g(42)
}
4 changes: 2 additions & 2 deletions tests/compile-fail/cast_fn_ptr5.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
fn main() {
fn f() -> u32 { 42 }
fn f() -> u32 { 42 } //~ ERROR calling a function with return type u32 passing return place of type ()

let g = unsafe {
std::mem::transmute::<fn() -> u32, fn()>(f)
};

g() //~ ERROR calling a function with return type u32 passing return place of type ()
g()
}
2 changes: 1 addition & 1 deletion tests/compile-fail/pointer_byte_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ fn main() {
let y = &x;
let z = &y as *const &i32 as *const u8;
// the deref fails, because we are reading only a part of the pointer
let _val = unsafe { *z }; //~ ERROR unable to turn this pointer into raw bytes
let _val = unsafe { *z }; //~ ERROR unable to turn pointer into raw bytes
}
2 changes: 1 addition & 1 deletion tests/compile-fail/reading_half_a_pointer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ fn main() {
// starts 1 byte to the right, so using it would actually be wrong!
let d_alias = &mut w.data as *mut _ as *mut *const u8;
unsafe {
let _x = *d_alias; //~ ERROR unable to turn this pointer into raw bytes
let _x = *d_alias; //~ ERROR unable to turn pointer into raw bytes
}
}
2 changes: 1 addition & 1 deletion tests/compile-fail/transmute_fat1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ fn main() {
let bad = unsafe {
std::mem::transmute::<&[u8], [u8; 8]>(&[1u8])
};
let _val = bad[0] + bad[bad.len()-1]; //~ ERROR unable to turn this pointer into raw bytes
let _val = bad[0] + bad[bad.len()-1]; //~ ERROR unable to turn pointer into raw bytes
}

0 comments on commit 49051e0

Please sign in to comment.