File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 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>(
640640 sym:: assert_inhabited | sym:: assert_zero_valid | sym:: assert_mem_uninitialized_valid => {
641641 intrinsic_args ! ( fx, args => ( ) ; intrinsic) ;
642642
643- let layout = fx. layout_of ( substs. type_at ( 0 ) ) ;
643+ let ty = substs. type_at ( 0 ) ;
644+ let layout = fx. layout_of ( ty) ;
644645 if layout. abi . is_uninhabited ( ) {
645646 with_no_trimmed_paths ! ( {
646647 crate :: base:: codegen_panic_nounwind(
@@ -653,7 +654,10 @@ fn codegen_regular_intrinsic_call<'tcx>(
653654 }
654655
655656 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" )
657661 {
658662 with_no_trimmed_paths ! ( {
659663 crate :: base:: codegen_panic_nounwind(
@@ -669,7 +673,10 @@ fn codegen_regular_intrinsic_call<'tcx>(
669673 }
670674
671675 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" )
673680 {
674681 with_no_trimmed_paths ! ( {
675682 crate :: base:: codegen_panic_nounwind(
You can’t perform that action at this time.
0 commit comments