diff options
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/ty/infer.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 792d02132..40559c3de 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs | |||
@@ -56,7 +56,7 @@ pub fn infer(db: &impl HirDatabase, func: Function) -> Arc<InferenceResult> { | |||
56 | } | 56 | } |
57 | 57 | ||
58 | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] | 58 | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] |
59 | pub enum ExprOrPatId { | 59 | enum ExprOrPatId { |
60 | Expr(ExprId), | 60 | Expr(ExprId), |
61 | Pat(PatId), | 61 | Pat(PatId), |
62 | } | 62 | } |
@@ -93,8 +93,11 @@ impl InferenceResult { | |||
93 | pub fn field_resolution(&self, expr: ExprId) -> Option<StructField> { | 93 | pub fn field_resolution(&self, expr: ExprId) -> Option<StructField> { |
94 | self.field_resolutions.get(&expr).map(|it| *it) | 94 | self.field_resolutions.get(&expr).map(|it| *it) |
95 | } | 95 | } |
96 | pub fn assoc_resolutions(&self, id: ExprOrPatId) -> Option<ImplItem> { | 96 | pub fn assoc_resolutions_for_expr(&self, id: ExprId) -> Option<ImplItem> { |
97 | self.assoc_resolutions.get(&id).map(|it| *it) | 97 | self.assoc_resolutions.get(&id.into()).map(|it| *it) |
98 | } | ||
99 | pub fn assoc_resolutions_for_pat(&self, id: PatId) -> Option<ImplItem> { | ||
100 | self.assoc_resolutions.get(&id.into()).map(|it| *it) | ||
98 | } | 101 | } |
99 | } | 102 | } |
100 | 103 | ||