Skip to content

Commit

Permalink
Sync from rust 9a7cc6c
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Feb 17, 2023
2 parents 8ed6baa + f58bd0e commit 8e5a9bb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
18 changes: 7 additions & 11 deletions src/driver/aot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
})
}
Expand Down
12 changes: 8 additions & 4 deletions src/intrinsics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8e5a9bb

Please sign in to comment.