aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/traits
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/traits')
-rw-r--r--crates/hir_ty/src/traits/chalk/mapping.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs
index 13d8d1111..3047fbacb 100644
--- a/crates/hir_ty/src/traits/chalk/mapping.rs
+++ b/crates/hir_ty/src/traits/chalk/mapping.rs
@@ -3,7 +3,7 @@
3//! Chalk (in both directions); plus some helper functions for more specialized 3//! Chalk (in both directions); plus some helper functions for more specialized
4//! conversions. 4//! conversions.
5 5
6use chalk_ir::{cast::Cast, fold::shift::Shift, interner::HasInterner, LifetimeData}; 6use chalk_ir::{cast::Cast, interner::HasInterner, LifetimeData};
7use chalk_solve::rust_ir; 7use chalk_solve::rust_ir;
8 8
9use base_db::salsa::InternKey; 9use base_db::salsa::InternKey;
@@ -25,7 +25,7 @@ impl ToChalk for Ty {
25 TyKind::Ref(m, ty) => ref_to_chalk(db, m, ty), 25 TyKind::Ref(m, ty) => ref_to_chalk(db, m, ty),
26 TyKind::Array(ty) => array_to_chalk(db, ty), 26 TyKind::Array(ty) => array_to_chalk(db, ty),
27 TyKind::Function(FnPointer { sig, substitution: substs, .. }) => { 27 TyKind::Function(FnPointer { sig, substitution: substs, .. }) => {
28 let substitution = chalk_ir::FnSubst(substs.0.to_chalk(db).shifted_in(&Interner)); 28 let substitution = chalk_ir::FnSubst(substs.0.to_chalk(db));
29 chalk_ir::TyKind::Function(chalk_ir::FnPointer { 29 chalk_ir::TyKind::Function(chalk_ir::FnPointer {
30 num_binders: 0, 30 num_binders: 0,
31 sig, 31 sig,
@@ -132,10 +132,7 @@ impl ToChalk for Ty {
132 .. 132 ..
133 }) => { 133 }) => {
134 assert_eq!(num_binders, 0); 134 assert_eq!(num_binders, 0);
135 let substs = crate::FnSubst(from_chalk( 135 let substs = crate::FnSubst(from_chalk(db, substitution.0));
136 db,
137 substitution.0.shifted_out(&Interner).expect("fn ptr should have no binders"),
138 ));
139 TyKind::Function(FnPointer { num_binders, sig, substitution: substs }) 136 TyKind::Function(FnPointer { num_binders, sig, substitution: substs })
140 } 137 }
141 chalk_ir::TyKind::BoundVar(idx) => TyKind::BoundVar(idx), 138 chalk_ir::TyKind::BoundVar(idx) => TyKind::BoundVar(idx),