rustc_target: TyAndLayout::field should never error.
This commit is contained in:
@@ -789,7 +789,7 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
|
||||
return;
|
||||
}
|
||||
|
||||
if intrinsic == sym::assert_zero_valid && !layout.might_permit_raw_init(fx, /*zero:*/ true).unwrap() {
|
||||
if intrinsic == sym::assert_zero_valid && !layout.might_permit_raw_init(fx, /*zero:*/ true) {
|
||||
with_no_trimmed_paths(|| crate::base::codegen_panic(
|
||||
fx,
|
||||
&format!("attempted to zero-initialize type `{}`, which is invalid", T),
|
||||
@@ -798,7 +798,7 @@ pub(crate) fn codegen_intrinsic_call<'tcx>(
|
||||
return;
|
||||
}
|
||||
|
||||
if intrinsic == sym::assert_uninit_valid && !layout.might_permit_raw_init(fx, /*zero:*/ false).unwrap() {
|
||||
if intrinsic == sym::assert_uninit_valid && !layout.might_permit_raw_init(fx, /*zero:*/ false) {
|
||||
with_no_trimmed_paths(|| crate::base::codegen_panic(
|
||||
fx,
|
||||
&format!("attempted to leave type `{}` uninitialized, which is invalid", T),
|
||||
|
||||
Reference in New Issue
Block a user