diff options
Diffstat (limited to 'crates/hir_ty/src/traits/chalk.rs')
-rw-r--r-- | crates/hir_ty/src/traits/chalk.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/crates/hir_ty/src/traits/chalk.rs b/crates/hir_ty/src/traits/chalk.rs index dff87ef70..5a8b5cd86 100644 --- a/crates/hir_ty/src/traits/chalk.rs +++ b/crates/hir_ty/src/traits/chalk.rs | |||
@@ -220,7 +220,8 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> { | |||
220 | let impl_bound = WhereClause::Implemented(TraitRef { | 220 | let impl_bound = WhereClause::Implemented(TraitRef { |
221 | trait_id: to_chalk_trait_id(future_trait), | 221 | trait_id: to_chalk_trait_id(future_trait), |
222 | // Self type as the first parameter. | 222 | // Self type as the first parameter. |
223 | substitution: Substitution::single( | 223 | substitution: Substitution::from1( |
224 | &Interner, | ||
224 | TyKind::BoundVar(BoundVar { | 225 | TyKind::BoundVar(BoundVar { |
225 | debruijn: DebruijnIndex::INNERMOST, | 226 | debruijn: DebruijnIndex::INNERMOST, |
226 | index: 0, | 227 | index: 0, |
@@ -232,7 +233,8 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> { | |||
232 | alias: AliasTy::Projection(ProjectionTy { | 233 | alias: AliasTy::Projection(ProjectionTy { |
233 | associated_ty_id: to_assoc_type_id(future_output), | 234 | associated_ty_id: to_assoc_type_id(future_output), |
234 | // Self type as the first parameter. | 235 | // Self type as the first parameter. |
235 | substitution: Substitution::single( | 236 | substitution: Substitution::from1( |
237 | &Interner, | ||
236 | TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, 0)) | 238 | TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, 0)) |
237 | .intern(&Interner), | 239 | .intern(&Interner), |
238 | ), | 240 | ), |
@@ -244,8 +246,8 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> { | |||
244 | let bound = OpaqueTyDatumBound { | 246 | let bound = OpaqueTyDatumBound { |
245 | bounds: make_binders( | 247 | bounds: make_binders( |
246 | vec![ | 248 | vec![ |
247 | wrap_in_empty_binders(impl_bound).to_chalk(self.db), | 249 | crate::wrap_empty_binders(impl_bound).to_chalk(self.db), |
248 | wrap_in_empty_binders(proj_bound).to_chalk(self.db), | 250 | crate::wrap_empty_binders(proj_bound).to_chalk(self.db), |
249 | ], | 251 | ], |
250 | 1, | 252 | 1, |
251 | ), | 253 | ), |
@@ -721,7 +723,3 @@ impl From<crate::db::InternedClosureId> for chalk_ir::ClosureId<Interner> { | |||
721 | chalk_ir::ClosureId(id.as_intern_id()) | 723 | chalk_ir::ClosureId(id.as_intern_id()) |
722 | } | 724 | } |
723 | } | 725 | } |
724 | |||
725 | fn wrap_in_empty_binders<T: crate::TypeWalk>(value: T) -> crate::Binders<T> { | ||
726 | crate::Binders::wrap_empty(value) | ||
727 | } | ||