File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -588,13 +588,8 @@ impl<'db> InferenceContext<'_, 'db> {
588588 let ret_param_ty = projection. skip_binder ( ) . term . expect_type ( ) ;
589589 debug ! ( ?ret_param_ty) ;
590590
591- let sig = projection. rebind ( self . interner ( ) . mk_fn_sig (
592- input_tys,
593- ret_param_ty,
594- false ,
595- Safety :: Safe ,
596- FnAbi :: Rust ,
597- ) ) ;
591+ let sig =
592+ projection. rebind ( self . interner ( ) . mk_fn_sig_safe_rust_abi ( input_tys, ret_param_ty) ) ;
598593
599594 Some ( sig)
600595 }
@@ -676,13 +671,7 @@ impl<'db> InferenceContext<'_, 'db> {
676671 // that does not misuse a `FnSig` type, but that can be done separately.
677672 let return_ty = return_ty. unwrap_or_else ( || self . table . next_ty_var ( ) ) ;
678673
679- let sig = projection. rebind ( self . interner ( ) . mk_fn_sig (
680- input_tys,
681- return_ty,
682- false ,
683- Safety :: Safe ,
684- FnAbi :: Rust ,
685- ) ) ;
674+ let sig = projection. rebind ( self . interner ( ) . mk_fn_sig_safe_rust_abi ( input_tys, return_ty) ) ;
686675
687676 Some ( sig)
688677 }
Original file line number Diff line number Diff line change @@ -2360,6 +2360,22 @@ impl<'db> DbInterner<'db> {
23602360 abi,
23612361 }
23622362 }
2363+
2364+ /// `mk_fn_sig`, but with a safe Rust ABI, and no C-variadic argument.
2365+ pub fn mk_fn_sig_safe_rust_abi < I > ( self , inputs : I , output : Ty < ' db > ) -> FnSig < ' db >
2366+ where
2367+ I : IntoIterator < Item = Ty < ' db > > ,
2368+ {
2369+ FnSig {
2370+ inputs_and_output : Tys :: new_from_iter (
2371+ self ,
2372+ inputs. into_iter ( ) . chain ( std:: iter:: once ( output) ) ,
2373+ ) ,
2374+ c_variadic : false ,
2375+ safety : Safety :: Safe ,
2376+ abi : FnAbi :: Rust ,
2377+ }
2378+ }
23632379}
23642380
23652381fn predicates_of ( db : & dyn HirDatabase , def_id : SolverDefId ) -> & GenericPredicates {
Original file line number Diff line number Diff line change 1- e8e4541ff19649d95afab52fdde2c2eaa6829965
1+ e22c616e4e87914135c1db261a03e0437255335e
You can’t perform that action at this time.
0 commit comments