This commit is contained in:
hyd-dev 2021-06-15 16:11:49 +08:00
parent d39f0c64b8
commit dfd7a6d5aa
No known key found for this signature in database
GPG Key ID: 74FA7FD5B8DA14B8
5 changed files with 5 additions and 5 deletions

View File

@ -1 +1 @@
a50d72158e08e02cfc051b863017bdbd2c45b637
d74b36ea2f814b720c39d7b60aecaefe512a056b

View File

@ -4,5 +4,5 @@ pub enum Foo {
}
fn main() {
let _f = unsafe { std::mem::transmute::<i32, Foo>(42) }; //~ ERROR encountered 0x0000002a at .<enum-tag>, but expected a valid enum tag
let _f = unsafe { std::mem::transmute::<i32, Foo>(42) }; //~ ERROR type validation failed at .<enum-tag>: encountered 0x0000002a, but expected a valid enum tag
}

View File

@ -266,5 +266,5 @@ union MyUninit {
}
fn main() {
let _a = unsafe { MyUninit { init: () }.uninit }; //~ ERROR encountered uninitialized bytes at .<enum-tag>, but expected a valid enum tag
let _a = unsafe { MyUninit { init: () }.uninit }; //~ ERROR type validation failed at .<enum-tag>: encountered uninitialized bytes, but expected a valid enum tag
}

View File

@ -11,6 +11,6 @@ fn main() {
let mut x = Bool::True;
evil(&mut x);
let y = x; // reading this ought to be enough to trigger validation
//~^ ERROR encountered 0x0000002c at .<enum-tag>, but expected a valid enum tag
//~^ ERROR type validation failed at .<enum-tag>: encountered 0x0000002c, but expected a valid enum tag
println!("{:?}", y); // make sure it is used (and not optimized away)
}

View File

@ -1,4 +1,4 @@
#![feature(maybe_uninit_extra, maybe_uninit_ref)]
#![feature(maybe_uninit_extra)]
use std::mem::MaybeUninit;
use std::cell::{Cell, RefCell, UnsafeCell};