Sync from rust 9a7cc6c32f1a690f86827e4724bcda85e506ef35

This commit is contained in:
bjorn3 2023-02-17 18:49:57 +01:00
commit 8e5a9bb77d
2 changed files with 15 additions and 15 deletions

View File

@ -248,17 +248,13 @@ fn reuse_workproduct_for_cgu(
dwarf_object: None,
bytecode: None,
},
module_global_asm: if has_global_asm {
Some(CompiledModule {
name: cgu.name().to_string(),
kind: ModuleKind::Regular,
object: Some(obj_out_global_asm),
dwarf_object: None,
bytecode: None,
})
} else {
None
},
module_global_asm: has_global_asm.then(|| CompiledModule {
name: cgu.name().to_string(),
kind: ModuleKind::Regular,
object: Some(obj_out_global_asm),
dwarf_object: None,
bytecode: None,
}),
existing_work_product: Some((cgu.work_product_id(), work_product)),
})
}

View File

@ -644,10 +644,14 @@ fn codegen_regular_intrinsic_call<'tcx>(
let layout = fx.layout_of(ty);
let do_panic = match intrinsic {
sym::assert_inhabited => layout.abi.is_uninhabited(),
sym::assert_zero_valid => !fx.tcx.permits_zero_init(fx.param_env().and(layout)),
sym::assert_mem_uninitialized_valid => {
!fx.tcx.permits_uninit_init(fx.param_env().and(layout))
}
sym::assert_zero_valid => !fx
.tcx
.permits_zero_init(fx.param_env().and(ty))
.expect("expected to have layout during codegen"),
sym::assert_mem_uninitialized_valid => !fx
.tcx
.permits_uninit_init(fx.param_env().and(ty))
.expect("expected to have layout during codegen"),
_ => unreachable!(),
};
if do_panic {