aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
authorkjeremy <[email protected]>2019-03-04 14:49:18 +0000
committerkjeremy <[email protected]>2019-03-04 14:49:18 +0000
commit1578375b89848b98a4d5187aaf794bc227d1eda6 (patch)
tree973b21649fd2bc64a2e693212df42e35dd21c0c7 /crates/ra_hir/src
parent79f61dcb0e3de873c4685c9abaaf4ec5af748000 (diff)
Make ExpOrPatId private
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/ty/infer.rs9
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)]
59pub enum ExprOrPatId { 59enum 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