From de9e964e4ac21897bd48adbe37f379d74422919f Mon Sep 17 00:00:00 2001 From: Paul Daniel Faria Date: Thu, 25 Jun 2020 12:42:12 -0400 Subject: Track import type outside of , use enum rather than bool to improve readability --- crates/ra_hir_def/src/body/lower.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir_def/src/body') diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 3ced648e5..d749c828d 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs @@ -26,7 +26,7 @@ use crate::{ dummy_expr_id, ArithOp, Array, BinaryOp, BindingAnnotation, CmpOp, Expr, ExprId, Literal, LogicOp, MatchArm, Ordering, Pat, PatId, RecordFieldPat, RecordLitField, Statement, }, - item_scope::BuiltinShadowMode, + item_scope::{BuiltinShadowMode, ImportType}, item_tree::{FileItemTreeId, ItemTree, ItemTreeNode}, path::{GenericArgs, Path}, type_ref::{Mutability, Rawness, TypeRef}, @@ -81,6 +81,7 @@ pub(super) fn lower( map }, expander, + import_types: FxHashMap::default(), } .collect(params, body) } @@ -93,6 +94,7 @@ struct ExprCollector<'a> { source_map: BodySourceMap, item_trees: FxHashMap>, + import_types: FxHashMap, } impl ExprCollector<'_> { @@ -711,8 +713,10 @@ impl ExprCollector<'_> { _ => true, }; self.body.item_scope.push_res( + &mut self.import_types, name.as_name(), crate::per_ns::PerNs::from_def(def, vis, has_constructor), + ImportType::Named, ); } } -- cgit v1.2.3