diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-05 21:25:13 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-05 21:25:13 +0100 |
commit | 7ce0e9c9ca552e063855d60df7dca65ba9953fc3 (patch) | |
tree | 054c1874844107ba3f5ae0e17736213a6cb974ce /crates/hir_ty/src/traits | |
parent | f25c1e7c6a119a1035ba226f0735a0d6667a5db8 (diff) | |
parent | edc59d897d56815e8b9814cdc4ff084100e4f3b4 (diff) |
Merge #8358
8358: Align FnPointer with Chalk r=flodiebold a=flodiebold
CC #8313
Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/traits')
-rw-r--r-- | crates/hir_ty/src/traits/chalk/mapping.rs | 10 |
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, |