diff options
author | Paul Daniel Faria <[email protected]> | 2020-06-25 17:42:12 +0100 |
---|---|---|
committer | Paul Daniel Faria <[email protected]> | 2020-06-25 17:42:12 +0100 |
commit | de9e964e4ac21897bd48adbe37f379d74422919f (patch) | |
tree | 75749d75444e360b89b3161623934e2f255ff643 /crates/ra_hir_def/src/body | |
parent | 0b657ddbfe9754afce9811c70a4e61e4ea9efeaf (diff) |
Track import type outside of , use enum rather than bool to improve readability
Diffstat (limited to 'crates/ra_hir_def/src/body')
-rw-r--r-- | crates/ra_hir_def/src/body/lower.rs | 6 |
1 files changed, 5 insertions, 1 deletions
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::{ | |||
26 | dummy_expr_id, ArithOp, Array, BinaryOp, BindingAnnotation, CmpOp, Expr, ExprId, Literal, | 26 | dummy_expr_id, ArithOp, Array, BinaryOp, BindingAnnotation, CmpOp, Expr, ExprId, Literal, |
27 | LogicOp, MatchArm, Ordering, Pat, PatId, RecordFieldPat, RecordLitField, Statement, | 27 | LogicOp, MatchArm, Ordering, Pat, PatId, RecordFieldPat, RecordLitField, Statement, |
28 | }, | 28 | }, |
29 | item_scope::BuiltinShadowMode, | 29 | item_scope::{BuiltinShadowMode, ImportType}, |
30 | item_tree::{FileItemTreeId, ItemTree, ItemTreeNode}, | 30 | item_tree::{FileItemTreeId, ItemTree, ItemTreeNode}, |
31 | path::{GenericArgs, Path}, | 31 | path::{GenericArgs, Path}, |
32 | type_ref::{Mutability, Rawness, TypeRef}, | 32 | type_ref::{Mutability, Rawness, TypeRef}, |
@@ -81,6 +81,7 @@ pub(super) fn lower( | |||
81 | map | 81 | map |
82 | }, | 82 | }, |
83 | expander, | 83 | expander, |
84 | import_types: FxHashMap::default(), | ||
84 | } | 85 | } |
85 | .collect(params, body) | 86 | .collect(params, body) |
86 | } | 87 | } |
@@ -93,6 +94,7 @@ struct ExprCollector<'a> { | |||
93 | source_map: BodySourceMap, | 94 | source_map: BodySourceMap, |
94 | 95 | ||
95 | item_trees: FxHashMap<HirFileId, Arc<ItemTree>>, | 96 | item_trees: FxHashMap<HirFileId, Arc<ItemTree>>, |
97 | import_types: FxHashMap<Name, ImportType>, | ||
96 | } | 98 | } |
97 | 99 | ||
98 | impl ExprCollector<'_> { | 100 | impl ExprCollector<'_> { |
@@ -711,8 +713,10 @@ impl ExprCollector<'_> { | |||
711 | _ => true, | 713 | _ => true, |
712 | }; | 714 | }; |
713 | self.body.item_scope.push_res( | 715 | self.body.item_scope.push_res( |
716 | &mut self.import_types, | ||
714 | name.as_name(), | 717 | name.as_name(), |
715 | crate::per_ns::PerNs::from_def(def, vis, has_constructor), | 718 | crate::per_ns::PerNs::from_def(def, vis, has_constructor), |
719 | ImportType::Named, | ||
716 | ); | 720 | ); |
717 | } | 721 | } |
718 | } | 722 | } |