@@ -162,7 +162,7 @@ impl<'tcx> GotocCtx<'tcx> {
162
162
( $f: ident) => { {
163
163
let mm = self . symbol_table. machine_model( ) ;
164
164
let casted_fargs =
165
- Expr :: cast_arguments_to_machine_equivalent_function_parameter_types (
165
+ Expr :: cast_arguments_to_target_equivalent_function_parameter_types (
166
166
& BuiltinFn :: $f. as_expr( ) ,
167
167
fargs,
168
168
mm,
@@ -783,19 +783,22 @@ impl<'tcx> GotocCtx<'tcx> {
783
783
) ;
784
784
}
785
785
786
- let param_env_and_layout = ty:: ParamEnv :: reveal_all ( ) . and ( layout ) ;
786
+ let param_env_and_type = ty:: ParamEnv :: reveal_all ( ) . and ( ty ) ;
787
787
788
788
// Then we check if the type allows "raw" initialization for the cases
789
789
// 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
+ {
791
793
return self . codegen_fatal_error (
792
794
PropertyClass :: SafetyCheck ,
793
795
& format ! ( "attempted to zero-initialize type `{ty}`, which is invalid" ) ,
794
796
span,
795
797
) ;
796
798
}
797
799
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 ( )
799
802
{
800
803
return self . codegen_fatal_error (
801
804
PropertyClass :: SafetyCheck ,
0 commit comments