@@ -162,7 +162,7 @@ impl<'tcx> GotocCtx<'tcx> {
162162 ( $f: ident) => { {
163163 let mm = self . symbol_table. machine_model( ) ;
164164 let casted_fargs =
165- Expr :: cast_arguments_to_machine_equivalent_function_parameter_types (
165+ Expr :: cast_arguments_to_target_equivalent_function_parameter_types (
166166 & BuiltinFn :: $f. as_expr( ) ,
167167 fargs,
168168 mm,
@@ -783,19 +783,22 @@ impl<'tcx> GotocCtx<'tcx> {
783783 ) ;
784784 }
785785
786- let param_env_and_layout = ty:: ParamEnv :: reveal_all ( ) . and ( layout ) ;
786+ let param_env_and_type = ty:: ParamEnv :: reveal_all ( ) . and ( ty ) ;
787787
788788 // Then we check if the type allows "raw" initialization for the cases
789789 // where memory is zero-initialized or entirely uninitialized
790- if intrinsic == "assert_zero_valid" && !self . tcx . permits_zero_init ( param_env_and_layout) {
790+ if intrinsic == "assert_zero_valid"
791+ && !self . tcx . permits_zero_init ( param_env_and_type) . ok ( ) . unwrap ( )
792+ {
791793 return self . codegen_fatal_error (
792794 PropertyClass :: SafetyCheck ,
793795 & format ! ( "attempted to zero-initialize type `{ty}`, which is invalid" ) ,
794796 span,
795797 ) ;
796798 }
797799
798- if intrinsic == "assert_uninit_valid" && !self . tcx . permits_uninit_init ( param_env_and_layout)
800+ if intrinsic == "assert_uninit_valid"
801+ && !self . tcx . permits_uninit_init ( param_env_and_type) . ok ( ) . unwrap ( )
799802 {
800803 return self . codegen_fatal_error (
801804 PropertyClass :: SafetyCheck ,
0 commit comments