Skip to content

Commit 8e5a9bb

Browse files
committed
Sync from rust 9a7cc6c32f1a690f86827e4724bcda85e506ef35
2 parents 8ed6baa + f58bd0e commit 8e5a9bb

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/driver/aot.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -248,17 +248,13 @@ fn reuse_workproduct_for_cgu(
248248
dwarf_object: None,
249249
bytecode: None,
250250
},
251-
module_global_asm: if has_global_asm {
252-
Some(CompiledModule {
253-
name: cgu.name().to_string(),
254-
kind: ModuleKind::Regular,
255-
object: Some(obj_out_global_asm),
256-
dwarf_object: None,
257-
bytecode: None,
258-
})
259-
} else {
260-
None
261-
},
251+
module_global_asm: has_global_asm.then(|| CompiledModule {
252+
name: cgu.name().to_string(),
253+
kind: ModuleKind::Regular,
254+
object: Some(obj_out_global_asm),
255+
dwarf_object: None,
256+
bytecode: None,
257+
}),
262258
existing_work_product: Some((cgu.work_product_id(), work_product)),
263259
})
264260
}

src/intrinsics/mod.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -644,10 +644,14 @@ fn codegen_regular_intrinsic_call<'tcx>(
644644
let layout = fx.layout_of(ty);
645645
let do_panic = match intrinsic {
646646
sym::assert_inhabited => layout.abi.is_uninhabited(),
647-
sym::assert_zero_valid => !fx.tcx.permits_zero_init(fx.param_env().and(layout)),
648-
sym::assert_mem_uninitialized_valid => {
649-
!fx.tcx.permits_uninit_init(fx.param_env().and(layout))
650-
}
647+
sym::assert_zero_valid => !fx
648+
.tcx
649+
.permits_zero_init(fx.param_env().and(ty))
650+
.expect("expected to have layout during codegen"),
651+
sym::assert_mem_uninitialized_valid => !fx
652+
.tcx
653+
.permits_uninit_init(fx.param_env().and(ty))
654+
.expect("expected to have layout during codegen"),
651655
_ => unreachable!(),
652656
};
653657
if do_panic {

0 commit comments

Comments
 (0)