File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -640,7 +640,8 @@ fn codegen_regular_intrinsic_call<'tcx>(
640
640
sym:: assert_inhabited | sym:: assert_zero_valid | sym:: assert_mem_uninitialized_valid => {
641
641
intrinsic_args ! ( fx, args => ( ) ; intrinsic) ;
642
642
643
- let layout = fx. layout_of ( substs. type_at ( 0 ) ) ;
643
+ let ty = substs. type_at ( 0 ) ;
644
+ let layout = fx. layout_of ( ty) ;
644
645
if layout. abi . is_uninhabited ( ) {
645
646
with_no_trimmed_paths ! ( {
646
647
crate :: base:: codegen_panic_nounwind(
@@ -653,7 +654,10 @@ fn codegen_regular_intrinsic_call<'tcx>(
653
654
}
654
655
655
656
if intrinsic == sym:: assert_zero_valid
656
- && !fx. tcx . permits_zero_init ( fx. param_env ( ) . and ( layout) )
657
+ && !fx
658
+ . tcx
659
+ . permits_zero_init ( fx. param_env ( ) . and ( ty) )
660
+ . expect ( "expected to have layout during codegen" )
657
661
{
658
662
with_no_trimmed_paths ! ( {
659
663
crate :: base:: codegen_panic_nounwind(
@@ -669,7 +673,10 @@ fn codegen_regular_intrinsic_call<'tcx>(
669
673
}
670
674
671
675
if intrinsic == sym:: assert_mem_uninitialized_valid
672
- && !fx. tcx . permits_uninit_init ( fx. param_env ( ) . and ( layout) )
676
+ && !fx
677
+ . tcx
678
+ . permits_uninit_init ( fx. param_env ( ) . and ( ty) )
679
+ . expect ( "expected to have layout during codegen" )
673
680
{
674
681
with_no_trimmed_paths ! ( {
675
682
crate :: base:: codegen_panic_nounwind(
You can’t perform that action at this time.
0 commit comments