From 0ad7317b24dc90c3787482f9ec563e7830d499fc Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Wed, 1 May 2019 17:57:56 +0200 Subject: Canonicalize before doing method resolution --- crates/ra_hir/src/ty.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'crates/ra_hir/src/ty.rs') 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 { } } +/// Basically a claim (currently not validated / checked) that the contained +/// type / trait ref contains no inference variables; any inference variables it +/// contained have been replaced by bound variables, and `num_vars` tells us how +/// many there are. This is used to erase irrelevant differences between types +/// before using them in queries. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub(crate) struct Canonical { + pub value: T, + pub num_vars: usize, +} + /// A function signature as seen by type inference: Several parameter types and /// one return type. #[derive(Clone, PartialEq, Eq, Debug)] -- cgit v1.2.3