diff options
Diffstat (limited to 'crates/ra_hir/src/source_binder.rs')
-rw-r--r-- | crates/ra_hir/src/source_binder.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index 4c173a4f7..fc9bc33d2 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs | |||
@@ -266,9 +266,14 @@ impl SourceAnalyzer { | |||
266 | self.infer.as_ref()?.field_resolution(expr_id) | 266 | self.infer.as_ref()?.field_resolution(expr_id) |
267 | } | 267 | } |
268 | 268 | ||
269 | pub fn resolve_variant(&self, struct_lit: &ast::StructLit) -> Option<crate::VariantDef> { | 269 | pub fn resolve_struct_literal(&self, struct_lit: &ast::StructLit) -> Option<crate::VariantDef> { |
270 | let expr_id = self.body_source_map.as_ref()?.node_expr(&struct_lit.clone().into())?; | 270 | let expr_id = self.body_source_map.as_ref()?.node_expr(&struct_lit.clone().into())?; |
271 | self.infer.as_ref()?.variant_resolution(expr_id) | 271 | self.infer.as_ref()?.variant_resolution_for_expr(expr_id) |
272 | } | ||
273 | |||
274 | pub fn resolve_struct_pattern(&self, struct_pat: &ast::StructPat) -> Option<crate::VariantDef> { | ||
275 | let pat_id = self.body_source_map.as_ref()?.node_pat(&struct_pat.clone().into())?; | ||
276 | self.infer.as_ref()?.variant_resolution_for_pat(pat_id) | ||
272 | } | 277 | } |
273 | 278 | ||
274 | pub fn resolve_macro_call( | 279 | pub fn resolve_macro_call( |