@@ -52,10 +52,10 @@ use crate::{
5252 tt,
5353 visibility:: { RawVisibility , Visibility } ,
5454 AdtId , AstId , AstIdWithPath , ConstLoc , CrateRootModuleId , EnumLoc , EnumVariantId ,
55- ExternBlockLoc , ExternCrateLoc , FunctionId , FunctionLoc , ImplLoc , ImportLoc , Intern ,
56- ItemContainerId , LocalModuleId , Macro2Id , Macro2Loc , MacroExpander , MacroId , MacroRulesId ,
57- MacroRulesLoc , ModuleDefId , ModuleId , ProcMacroId , ProcMacroLoc , StaticLoc , StructLoc ,
58- TraitAliasLoc , TraitLoc , TypeAliasLoc , UnionLoc , UnresolvedMacro ,
55+ ExternBlockLoc , ExternCrateLoc , FunctionId , FunctionLoc , ImplLoc , Intern , ItemContainerId ,
56+ LocalModuleId , Macro2Id , Macro2Loc , MacroExpander , MacroId , MacroRulesId , MacroRulesLoc ,
57+ ModuleDefId , ModuleId , ProcMacroId , ProcMacroLoc , StaticLoc , StructLoc , TraitAliasLoc ,
58+ TraitLoc , TypeAliasLoc , UnionLoc , UnresolvedMacro , UseLoc ,
5959} ;
6060
6161static GLOB_RECURSION_LIMIT : Limit = Limit :: new ( 100 ) ;
@@ -146,7 +146,7 @@ impl PartialResolvedImport {
146146
147147#[ derive( Clone , Debug , Eq , PartialEq ) ]
148148enum ImportSource {
149- Import { id : ItemTreeId < item_tree:: Import > , use_tree : Idx < ast:: UseTree > } ,
149+ Use { id : ItemTreeId < item_tree:: Use > , use_tree : Idx < ast:: UseTree > } ,
150150 ExternCrate ( ItemTreeId < item_tree:: ExternCrate > ) ,
151151}
152152
@@ -166,7 +166,7 @@ impl Import {
166166 db : & dyn DefDatabase ,
167167 krate : CrateId ,
168168 tree : & ItemTree ,
169- id : ItemTreeId < item_tree:: Import > ,
169+ id : ItemTreeId < item_tree:: Use > ,
170170 mut cb : impl FnMut ( Self ) ,
171171 ) {
172172 let it = & tree[ id. value ] ;
@@ -181,7 +181,7 @@ impl Import {
181181 kind,
182182 is_prelude,
183183 is_macro_use : false ,
184- source : ImportSource :: Import { id, use_tree : idx } ,
184+ source : ImportSource :: Use { id, use_tree : idx } ,
185185 } ) ;
186186 } ) ;
187187 }
@@ -1474,7 +1474,7 @@ impl DefCollector<'_> {
14741474 }
14751475
14761476 for directive in & self . unresolved_imports {
1477- if let ImportSource :: Import { id : import, use_tree } = directive. import . source {
1477+ if let ImportSource :: Use { id : import, use_tree } = directive. import . source {
14781478 if matches ! (
14791479 ( directive. import. path. segments( ) . first( ) , & directive. import. path. kind) ,
14801480 ( Some ( krate) , PathKind :: Plain | PathKind :: Abs ) if diagnosed_extern_crates. contains( krate)
@@ -1576,12 +1576,10 @@ impl ModCollector<'_, '_> {
15761576
15771577 match item {
15781578 ModItem :: Mod ( m) => self . collect_module ( m, & attrs) ,
1579- ModItem :: Import ( import_id) => {
1580- let _import_id = ImportLoc {
1581- container : module,
1582- id : ItemTreeId :: new ( self . tree_id , import_id) ,
1583- }
1584- . intern ( db) ;
1579+ ModItem :: Use ( import_id) => {
1580+ let _import_id =
1581+ UseLoc { container : module, id : ItemTreeId :: new ( self . tree_id , import_id) }
1582+ . intern ( db) ;
15851583 Import :: from_use (
15861584 db,
15871585 krate,
0 commit comments