File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ mod simd;
21
21
pub ( crate ) use cpuid:: codegen_cpuid_call;
22
22
pub ( crate ) use llvm:: codegen_llvm_intrinsic_call;
23
23
24
+ use rustc_middle:: ty:: layout:: HasParamEnv ;
24
25
use rustc_middle:: ty:: print:: with_no_trimmed_paths;
25
26
use rustc_middle:: ty:: subst:: SubstsRef ;
26
27
use rustc_span:: symbol:: { kw, sym, Symbol } ;
@@ -659,7 +660,9 @@ fn codegen_regular_intrinsic_call<'tcx>(
659
660
return ;
660
661
}
661
662
662
- if intrinsic == sym:: assert_zero_valid && !fx. tcx . permits_zero_init ( layout) {
663
+ if intrinsic == sym:: assert_zero_valid
664
+ && !fx. tcx . permits_zero_init ( fx. param_env ( ) . and ( layout) )
665
+ {
663
666
with_no_trimmed_paths ! ( {
664
667
crate :: base:: codegen_panic(
665
668
fx,
@@ -674,7 +677,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
674
677
}
675
678
676
679
if intrinsic == sym:: assert_mem_uninitialized_valid
677
- && !fx. tcx . permits_uninit_init ( layout)
680
+ && !fx. tcx . permits_uninit_init ( fx . param_env ( ) . and ( layout) )
678
681
{
679
682
with_no_trimmed_paths ! ( {
680
683
crate :: base:: codegen_panic(
You can’t perform that action at this time.
0 commit comments