rustup, fix for intrinsic rename and transmute error change

This commit is contained in:
Ralf Jung
2020-03-14 09:27:35 +01:00
parent 97c257530b
commit 497fbcbf44
3 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -1 +1 @@
54b7d21f59a363e53eb1c31d76b40af2ff99321c
1572c433eed495d0ade41511ae106b180e02851d
+5 -5
View File
@@ -438,20 +438,20 @@ fn call_intrinsic(
this.write_scalar(result_ptr, dest)?;
}
"panic_if_uninhabited" |
"panic_if_zero_invalid" |
"panic_if_any_invalid" => {
"assert_inhabited" |
"assert_zero_valid" |
"assert_uninit_valid" => {
let ty = substs.type_at(0);
let layout = this.layout_of(ty)?;
if layout.abi.is_uninhabited() {
// Return here because we paniced instead of returning normally from the intrinsic.
return this.start_panic(&format!("attempted to instantiate uninhabited type `{}`", ty), unwind);
}
if intrinsic_name == "panic_if_zero_invalid" && !layout.might_permit_raw_init(this, /*zero:*/ true).unwrap() {
if intrinsic_name == "assert_zero_valid" && !layout.might_permit_raw_init(this, /*zero:*/ true).unwrap() {
// Return here because we paniced instead of returning normally from the intrinsic.
return this.start_panic(&format!("attempted to zero-initialize type `{}`, which is invalid", ty), unwind);
}
if intrinsic_name == "panic_if_any_invalid" && !layout.might_permit_raw_init(this, /*zero:*/ false).unwrap() {
if intrinsic_name == "assert_uninit_valid" && !layout.might_permit_raw_init(this, /*zero:*/ false).unwrap() {
// Return here because we paniced instead of returning normally from the intrinsic.
return this.start_panic(&format!("attempted to leave type `{}` uninitialized, which is invalid", ty), unwind);
}
+1 -1
View File
@@ -7,6 +7,6 @@
fn main() {
let _x: ! = unsafe {
std::mem::transmute::<Human, !>(Human) //~ ERROR entering unreachable code
std::mem::transmute::<Human, !>(Human) //~ ERROR transmuting to uninhabited
};
}