Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/next_solver/interner.rs')
| -rw-r--r-- | crates/hir-ty/src/next_solver/interner.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crates/hir-ty/src/next_solver/interner.rs b/crates/hir-ty/src/next_solver/interner.rs index 622648bc8d..5d7ad84e1f 100644 --- a/crates/hir-ty/src/next_solver/interner.rs +++ b/crates/hir-ty/src/next_solver/interner.rs @@ -2358,6 +2358,22 @@ impl<'db> DbInterner<'db> { abi, } } + + /// `mk_fn_sig`, but with a safe Rust ABI, and no C-variadic argument. + pub fn mk_fn_sig_safe_rust_abi<I>(self, inputs: I, output: Ty<'db>) -> FnSig<'db> + where + I: IntoIterator<Item = Ty<'db>>, + { + FnSig { + inputs_and_output: Tys::new_from_iter( + self, + inputs.into_iter().chain(std::iter::once(output)), + ), + c_variadic: false, + safety: Safety::Safe, + abi: FnAbi::Rust, + } + } } fn predicates_of(db: &dyn HirDatabase, def_id: SolverDefId) -> &GenericPredicates { |