diff options
author | Florian Diebold <[email protected]> | 2021-04-05 21:23:16 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-04-05 21:23:30 +0100 |
commit | edc59d897d56815e8b9814cdc4ff084100e4f3b4 (patch) | |
tree | 054c1874844107ba3f5ae0e17736213a6cb974ce /crates/hir_ty/src/method_resolution.rs | |
parent | f25c1e7c6a119a1035ba226f0735a0d6667a5db8 (diff) |
Align FnPointer with Chalk
Diffstat (limited to 'crates/hir_ty/src/method_resolution.rs')
-rw-r--r-- | crates/hir_ty/src/method_resolution.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/hir_ty/src/method_resolution.rs b/crates/hir_ty/src/method_resolution.rs index d6de844a8..6d65d3eb9 100644 --- a/crates/hir_ty/src/method_resolution.rs +++ b/crates/hir_ty/src/method_resolution.rs | |||
@@ -46,18 +46,18 @@ impl TyFingerprint { | |||
46 | /// have impls: if we have some `struct S`, we can have an `impl S`, but not | 46 | /// have impls: if we have some `struct S`, we can have an `impl S`, but not |
47 | /// `impl &S`. Hence, this will return `None` for reference types and such. | 47 | /// `impl &S`. Hence, this will return `None` for reference types and such. |
48 | pub fn for_impl(ty: &Ty) -> Option<TyFingerprint> { | 48 | pub fn for_impl(ty: &Ty) -> Option<TyFingerprint> { |
49 | let fp = match *ty.kind(&Interner) { | 49 | let fp = match ty.kind(&Interner) { |
50 | TyKind::Str => TyFingerprint::Str, | 50 | TyKind::Str => TyFingerprint::Str, |
51 | TyKind::Never => TyFingerprint::Never, | 51 | TyKind::Never => TyFingerprint::Never, |
52 | TyKind::Slice(..) => TyFingerprint::Slice, | 52 | TyKind::Slice(..) => TyFingerprint::Slice, |
53 | TyKind::Array(..) => TyFingerprint::Array, | 53 | TyKind::Array(..) => TyFingerprint::Array, |
54 | TyKind::Scalar(scalar) => TyFingerprint::Scalar(scalar), | 54 | TyKind::Scalar(scalar) => TyFingerprint::Scalar(*scalar), |
55 | TyKind::Adt(AdtId(adt), _) => TyFingerprint::Adt(adt), | 55 | TyKind::Adt(AdtId(adt), _) => TyFingerprint::Adt(*adt), |
56 | TyKind::Tuple(cardinality, _) => TyFingerprint::Tuple(cardinality), | 56 | TyKind::Tuple(cardinality, _) => TyFingerprint::Tuple(*cardinality), |
57 | TyKind::Raw(mutability, ..) => TyFingerprint::RawPtr(mutability), | 57 | TyKind::Raw(mutability, ..) => TyFingerprint::RawPtr(*mutability), |
58 | TyKind::Foreign(alias_id, ..) => TyFingerprint::ForeignType(alias_id), | 58 | TyKind::Foreign(alias_id, ..) => TyFingerprint::ForeignType(*alias_id), |
59 | TyKind::Function(FnPointer { num_args, sig, .. }) => { | 59 | TyKind::Function(FnPointer { sig, substitution: substs, .. }) => { |
60 | TyFingerprint::FnPtr(num_args, sig) | 60 | TyFingerprint::FnPtr(substs.0.len(&Interner) - 1, *sig) |
61 | } | 61 | } |
62 | TyKind::Dyn(_) => ty.dyn_trait().map(|trait_| TyFingerprint::Dyn(trait_))?, | 62 | TyKind::Dyn(_) => ty.dyn_trait().map(|trait_| TyFingerprint::Dyn(trait_))?, |
63 | _ => return None, | 63 | _ => return None, |