Auto merge of #1398 - RalfJung:rustup, r=RalfJung

rustup; fix error messages
This commit is contained in:
bors 2020-05-07 06:42:59 +00:00
commit 2d3261de75
4 changed files with 4 additions and 4 deletions

View File

@ -1 +1 @@
ff4df04799c406c8149a041c3163321758aac924
97f3eeec8216d7155c24674b9be55e7c672bcae3

View File

@ -32,7 +32,7 @@ pub unsafe fn from_data_ptr(data: &String, ptr: *const Meta) -> &Self {
data: data as *const _ as *const (),
vtable: ptr as *const _ as *const (),
};
let obj = std::mem::transmute::<FatPointer, *mut FunnyPointer>(obj); //~ ERROR invalid drop fn in vtable
let obj = std::mem::transmute::<FatPointer, *mut FunnyPointer>(obj); //~ ERROR invalid drop function pointer in vtable
&*obj
}
}

View File

@ -3,5 +3,5 @@
use std::mem;
fn main() {
let _x: &i32 = unsafe { mem::transmute(16usize) }; //~ ERROR reference to unallocated address 16
let _x: &i32 = unsafe { mem::transmute(16usize) }; //~ ERROR encountered a dangling reference (address 16 is unallocated)
}

View File

@ -6,5 +6,5 @@ trait T { }
struct S {
x: * mut dyn T
}
dbg!(S { x: unsafe { std::mem::transmute((0usize, 0usize)) } }); //~ ERROR: encountered dangling or unaligned vtable pointer
dbg!(S { x: unsafe { std::mem::transmute((0usize, 0usize)) } }); //~ ERROR: encountered dangling vtable pointer
}