diff options
author | Florian Diebold <[email protected]> | 2019-05-01 16:57:56 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-05-04 17:18:30 +0100 |
commit | 0ad7317b24dc90c3787482f9ec563e7830d499fc (patch) | |
tree | b065393029bb8d886c3562af2e0fbcf1bc62a0e6 /crates/ra_hir/src/ty.rs | |
parent | ef77d8375130d12678d4b2316cc1708c90349dad (diff) |
Canonicalize before doing method resolution
Diffstat (limited to 'crates/ra_hir/src/ty.rs')
-rw-r--r-- | crates/ra_hir/src/ty.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index e7c39487d..6a79af35b 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs | |||
@@ -234,6 +234,17 @@ impl TraitRef { | |||
234 | } | 234 | } |
235 | } | 235 | } |
236 | 236 | ||
237 | /// Basically a claim (currently not validated / checked) that the contained | ||
238 | /// type / trait ref contains no inference variables; any inference variables it | ||
239 | /// contained have been replaced by bound variables, and `num_vars` tells us how | ||
240 | /// many there are. This is used to erase irrelevant differences between types | ||
241 | /// before using them in queries. | ||
242 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | ||
243 | pub(crate) struct Canonical<T> { | ||
244 | pub value: T, | ||
245 | pub num_vars: usize, | ||
246 | } | ||
247 | |||
237 | /// A function signature as seen by type inference: Several parameter types and | 248 | /// A function signature as seen by type inference: Several parameter types and |
238 | /// one return type. | 249 | /// one return type. |
239 | #[derive(Clone, PartialEq, Eq, Debug)] | 250 | #[derive(Clone, PartialEq, Eq, Debug)] |