File tree Expand file tree Collapse file tree 3 files changed +12
-16
lines changed Expand file tree Collapse file tree 3 files changed +12
-16
lines changed Original file line number Diff line number Diff line change @@ -92,13 +92,11 @@ pub fn param_idx(db: &dyn HirDatabase, id: TypeParamId) -> Option<usize> {
92
92
generics ( db. upcast ( ) , id. parent ) . param_idx ( id)
93
93
}
94
94
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 ) )
102
100
}
103
101
104
102
impl < T : TypeWalk > Binders < T > {
Original file line number Diff line number Diff line change @@ -384,7 +384,9 @@ impl<'a> TyLoweringContext<'a> {
384
384
1 ,
385
385
QuantifiedWhereClauses :: from_iter (
386
386
& Interner ,
387
- Some ( Binders :: wrap_empty ( WhereClause :: Implemented ( trait_ref) ) ) ,
387
+ Some ( crate :: wrap_empty_binders ( WhereClause :: Implemented (
388
+ trait_ref,
389
+ ) ) ) ,
388
390
) ,
389
391
) ,
390
392
} ;
@@ -720,7 +722,7 @@ impl<'a> TyLoweringContext<'a> {
720
722
let trait_ref = match bound {
721
723
TypeBound :: Path ( path) => {
722
724
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) )
724
726
}
725
727
TypeBound :: Lifetime ( _) => None ,
726
728
TypeBound :: Error => None ,
@@ -767,7 +769,7 @@ impl<'a> TyLoweringContext<'a> {
767
769
let ty = self . lower_ty ( type_ref) ;
768
770
let alias_eq =
769
771
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) ) ) ;
771
773
}
772
774
for bound in & binding. bounds {
773
775
preds. extend ( self . lower_type_bound (
Original file line number Diff line number Diff line change @@ -246,8 +246,8 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> {
246
246
let bound = OpaqueTyDatumBound {
247
247
bounds : make_binders (
248
248
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) ,
251
251
] ,
252
252
1 ,
253
253
) ,
@@ -723,7 +723,3 @@ impl From<crate::db::InternedClosureId> for chalk_ir::ClosureId<Interner> {
723
723
chalk_ir:: ClosureId ( id. as_intern_id ( ) )
724
724
}
725
725
}
726
-
727
- fn wrap_in_empty_binders < T : crate :: TypeWalk > ( value : T ) -> crate :: Binders < T > {
728
- crate :: Binders :: wrap_empty ( value)
729
- }
You can’t perform that action at this time.
0 commit comments