Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/next_solver/binder.rs')
-rw-r--r--crates/hir-ty/src/next_solver/binder.rs26
1 files changed, 24 insertions, 2 deletions
diff --git a/crates/hir-ty/src/next_solver/binder.rs b/crates/hir-ty/src/next_solver/binder.rs
index 84cfbf2767..22019f1ff9 100644
--- a/crates/hir-ty/src/next_solver/binder.rs
+++ b/crates/hir-ty/src/next_solver/binder.rs
@@ -4,8 +4,9 @@ use macros::{TypeFoldable, TypeVisitable};
use crate::{
FnAbi,
next_solver::{
- Binder, Clauses, DbInterner, EarlyBinder, FnSig, PolyFnSig, StoredBoundVarKinds,
- StoredClauses, StoredGenericArgs, StoredTy, StoredTys, TraitRef, Ty, abi::Safety,
+ Binder, Clauses, DbInterner, EarlyBinder, FnSig, GenericArg, PolyFnSig,
+ StoredBoundVarKinds, StoredClauses, StoredGenericArg, StoredGenericArgs, StoredTy,
+ StoredTys, TraitRef, Ty, abi::Safety,
},
};
@@ -41,6 +42,13 @@ impl StoredEarlyBinder<StoredTy> {
}
}
+impl StoredEarlyBinder<StoredGenericArg> {
+ #[inline]
+ pub fn get<'db>(&self) -> EarlyBinder<'db, GenericArg<'db>> {
+ self.get_with(|it| it.as_ref())
+ }
+}
+
impl StoredEarlyBinder<StoredClauses> {
#[inline]
pub fn get<'db>(&self) -> EarlyBinder<'db, Clauses<'db>> {
@@ -48,6 +56,20 @@ impl StoredEarlyBinder<StoredClauses> {
}
}
+impl StoredEarlyBinder<StoredPolyFnSig> {
+ #[inline]
+ pub fn get<'db>(&'db self) -> EarlyBinder<'db, PolyFnSig<'db>> {
+ self.get_with(|it| it.get())
+ }
+}
+
+impl StoredEarlyBinder<StoredTraitRef> {
+ #[inline]
+ pub fn get<'db>(&'db self, interner: DbInterner<'db>) -> EarlyBinder<'db, TraitRef<'db>> {
+ self.get_with(|it| it.get(interner))
+ }
+}
+
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct StoredPolyFnSig {
bound_vars: StoredBoundVarKinds,