aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/traits/chalk
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-04-05 21:23:16 +0100
committerFlorian Diebold <[email protected]>2021-04-05 21:23:30 +0100
commitedc59d897d56815e8b9814cdc4ff084100e4f3b4 (patch)
tree054c1874844107ba3f5ae0e17736213a6cb974ce /crates/hir_ty/src/traits/chalk
parentf25c1e7c6a119a1035ba226f0735a0d6667a5db8 (diff)
Align FnPointer with Chalk
Diffstat (limited to 'crates/hir_ty/src/traits/chalk')
-rw-r--r--crates/hir_ty/src/traits/chalk/mapping.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs
index 9f10b889f..13d8d1111 100644
--- a/crates/hir_ty/src/traits/chalk/mapping.rs
+++ b/crates/hir_ty/src/traits/chalk/mapping.rs
@@ -24,8 +24,8 @@ impl ToChalk for Ty {
24 match self.into_inner() { 24 match self.into_inner() {
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, substs, .. }) => { 27 TyKind::Function(FnPointer { sig, substitution: substs, .. }) => {
28 let substitution = chalk_ir::FnSubst(substs.to_chalk(db).shifted_in(&Interner)); 28 let substitution = chalk_ir::FnSubst(substs.0.to_chalk(db).shifted_in(&Interner));
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,11 +132,11 @@ impl ToChalk for Ty {
132 .. 132 ..
133 }) => { 133 }) => {
134 assert_eq!(num_binders, 0); 134 assert_eq!(num_binders, 0);
135 let substs: Substitution = from_chalk( 135 let substs = crate::FnSubst(from_chalk(
136 db, 136 db,
137 substitution.0.shifted_out(&Interner).expect("fn ptr should have no binders"), 137 substitution.0.shifted_out(&Interner).expect("fn ptr should have no binders"),
138 ); 138 ));
139 TyKind::Function(FnPointer { num_args: (substs.len(&Interner) - 1), sig, substs }) 139 TyKind::Function(FnPointer { num_binders, sig, substitution: substs })
140 } 140 }
141 chalk_ir::TyKind::BoundVar(idx) => TyKind::BoundVar(idx), 141 chalk_ir::TyKind::BoundVar(idx) => TyKind::BoundVar(idx),
142 chalk_ir::TyKind::InferenceVar(_iv, _kind) => TyKind::Error, 142 chalk_ir::TyKind::InferenceVar(_iv, _kind) => TyKind::Error,