Skip to content

Commit 7381746

Browse files
committed
Binders::wrap_empty -> wrap_empty_binders
1 parent 2f5a776 commit 7381746

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

crates/hir_ty/src/lib.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,11 @@ pub fn param_idx(db: &dyn HirDatabase, id: TypeParamId) -> Option<usize> {
9292
generics(db.upcast(), id.parent).param_idx(id)
9393
}
9494

95-
impl<T> Binders<T> {
96-
pub fn wrap_empty(value: T) -> Self
97-
where
98-
T: TypeWalk,
99-
{
100-
Binders::empty(&Interner, value.shifted_in_from(DebruijnIndex::ONE))
101-
}
95+
pub fn wrap_empty_binders<T>(value: T) -> Binders<T>
96+
where
97+
T: TypeWalk,
98+
{
99+
Binders::empty(&Interner, value.shifted_in_from(DebruijnIndex::ONE))
102100
}
103101

104102
impl<T: TypeWalk> Binders<T> {

crates/hir_ty/src/lower.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,9 @@ impl<'a> TyLoweringContext<'a> {
384384
1,
385385
QuantifiedWhereClauses::from_iter(
386386
&Interner,
387-
Some(Binders::wrap_empty(WhereClause::Implemented(trait_ref))),
387+
Some(crate::wrap_empty_binders(WhereClause::Implemented(
388+
trait_ref,
389+
))),
388390
),
389391
),
390392
};
@@ -720,7 +722,7 @@ impl<'a> TyLoweringContext<'a> {
720722
let trait_ref = match bound {
721723
TypeBound::Path(path) => {
722724
bindings = self.lower_trait_ref_from_path(path, Some(self_ty));
723-
bindings.clone().map(WhereClause::Implemented).map(|b| Binders::wrap_empty(b))
725+
bindings.clone().map(WhereClause::Implemented).map(|b| crate::wrap_empty_binders(b))
724726
}
725727
TypeBound::Lifetime(_) => None,
726728
TypeBound::Error => None,
@@ -767,7 +769,7 @@ impl<'a> TyLoweringContext<'a> {
767769
let ty = self.lower_ty(type_ref);
768770
let alias_eq =
769771
AliasEq { alias: AliasTy::Projection(projection_ty.clone()), ty };
770-
preds.push(Binders::wrap_empty(WhereClause::AliasEq(alias_eq)));
772+
preds.push(crate::wrap_empty_binders(WhereClause::AliasEq(alias_eq)));
771773
}
772774
for bound in &binding.bounds {
773775
preds.extend(self.lower_type_bound(

crates/hir_ty/src/traits/chalk.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> {
246246
let bound = OpaqueTyDatumBound {
247247
bounds: make_binders(
248248
vec![
249-
wrap_in_empty_binders(impl_bound).to_chalk(self.db),
250-
wrap_in_empty_binders(proj_bound).to_chalk(self.db),
249+
crate::wrap_empty_binders(impl_bound).to_chalk(self.db),
250+
crate::wrap_empty_binders(proj_bound).to_chalk(self.db),
251251
],
252252
1,
253253
),
@@ -723,7 +723,3 @@ impl From<crate::db::InternedClosureId> for chalk_ir::ClosureId<Interner> {
723723
chalk_ir::ClosureId(id.as_intern_id())
724724
}
725725
}
726-
727-
fn wrap_in_empty_binders<T: crate::TypeWalk>(value: T) -> crate::Binders<T> {
728-
crate::Binders::wrap_empty(value)
729-
}

0 commit comments

Comments
 (0)