From 316795e074dff8f627f8c70c85d236420ecfb3a6 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Tue, 24 Dec 2019 02:19:09 +0200 Subject: Initial auto import action implementation --- crates/ra_hir/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs index e1c7b7a20..be6dced53 100644 --- a/crates/ra_hir/src/lib.rs +++ b/crates/ra_hir/src/lib.rs @@ -58,6 +58,6 @@ pub use hir_def::{ type_ref::Mutability, }; pub use hir_expand::{ - name::Name, HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Origin, + name, name::Name, HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Origin, }; pub use hir_ty::{display::HirDisplay, CallableDef}; -- cgit v1.2.3 From d0a782ef1c53ef5c5d3b49b02c498f7a688c3a4d Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Fri, 24 Jan 2020 09:33:18 +0200 Subject: Have a better trait interface --- crates/ra_hir/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs index be6dced53..21b0553be 100644 --- a/crates/ra_hir/src/lib.rs +++ b/crates/ra_hir/src/lib.rs @@ -58,6 +58,7 @@ pub use hir_def::{ type_ref::Mutability, }; pub use hir_expand::{ - name, name::Name, HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Origin, + name::{AsName, Name}, + HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Origin, }; pub use hir_ty::{display::HirDisplay, CallableDef}; -- cgit v1.2.3 From 1a78991df69630b581b4210083c9e94157bab0e1 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Mon, 27 Jan 2020 00:16:18 +0200 Subject: Adjust the tests --- crates/ra_hir/src/lib.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs index 21b0553be..2cfeaba72 100644 --- a/crates/ra_hir/src/lib.rs +++ b/crates/ra_hir/src/lib.rs @@ -56,6 +56,7 @@ pub use hir_def::{ nameres::ModuleSource, path::{ModPath, Path, PathKind}, type_ref::Mutability, + ModuleDefId, }; pub use hir_expand::{ name::{AsName, Name}, -- cgit v1.2.3 From 9be1ab7ff948d89334a8acbc309c8235d4ab374f Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Mon, 27 Jan 2020 14:42:45 +0200 Subject: Code review fixes --- crates/ra_hir/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs index 2cfeaba72..9e2673d13 100644 --- a/crates/ra_hir/src/lib.rs +++ b/crates/ra_hir/src/lib.rs @@ -56,10 +56,9 @@ pub use hir_def::{ nameres::ModuleSource, path::{ModPath, Path, PathKind}, type_ref::Mutability, - ModuleDefId, + ModuleDefId, // FIXME this is exposed and should be used for implementing the `TestImportsLocator` in `ra_assists` only, should be removed later along with the trait and the implementation. }; pub use hir_expand::{ - name::{AsName, Name}, - HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Origin, + name::Name, HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Origin, }; pub use hir_ty::{display::HirDisplay, CallableDef}; -- cgit v1.2.3 From f1720d7983b15a404dd3025c90afde9cc3773222 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 29 Jan 2020 16:10:46 +0100 Subject: Re-sync queries for memory usage measurnment --- crates/ra_hir/src/db.rs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/db.rs b/crates/ra_hir/src/db.rs index e6079b88d..a77bf6de6 100644 --- a/crates/ra_hir/src/db.rs +++ b/crates/ra_hir/src/db.rs @@ -1,20 +1,24 @@ //! FIXME: write short doc here pub use hir_def::db::{ - BodyQuery, BodyWithSourceMapQuery, ComputeCrateDefMapQuery, ConstDataQuery, + AttrsQuery, BodyQuery, BodyWithSourceMapQuery, ComputeCrateDefMapQuery, ConstDataQuery, CrateLangItemsQuery, DefDatabase, DefDatabaseStorage, DocumentationQuery, EnumDataQuery, - ExprScopesQuery, FunctionDataQuery, GenericParamsQuery, ImplDataQuery, InternDatabase, - InternDatabaseStorage, LangItemQuery, ModuleLangItemsQuery, RawItemsQuery, StaticDataQuery, - StructDataQuery, TraitDataQuery, TypeAliasDataQuery, + ExprScopesQuery, FunctionDataQuery, GenericParamsQuery, ImplDataQuery, InternConstQuery, + InternDatabase, InternDatabaseStorage, InternEnumQuery, InternFunctionQuery, InternImplQuery, + InternStaticQuery, InternStructQuery, InternTraitQuery, InternTypeAliasQuery, InternUnionQuery, + LangItemQuery, ModuleLangItemsQuery, RawItemsQuery, StaticDataQuery, StructDataQuery, + TraitDataQuery, TypeAliasDataQuery, UnionDataQuery, }; pub use hir_expand::db::{ - AstDatabase, AstDatabaseStorage, AstIdMapQuery, MacroArgQuery, MacroDefQuery, MacroExpandQuery, - ParseMacroQuery, + AstDatabase, AstDatabaseStorage, AstIdMapQuery, InternMacroQuery, MacroArgQuery, MacroDefQuery, + MacroExpandQuery, ParseMacroQuery, }; pub use hir_ty::db::{ - AssociatedTyDataQuery, CallableItemSignatureQuery, DoInferQuery, FieldTypesQuery, - GenericDefaultsQuery, GenericPredicatesQuery, HirDatabase, HirDatabaseStorage, ImplDatumQuery, - ImplsForTraitQuery, ImplsInCrateQuery, StructDatumQuery, TraitDatumQuery, TraitSolveQuery, + AssociatedTyDataQuery, AssociatedTyValueQuery, CallableItemSignatureQuery, DoInferQuery, + FieldTypesQuery, GenericDefaultsQuery, GenericPredicatesForParamQuery, GenericPredicatesQuery, + HirDatabase, HirDatabaseStorage, ImplDatumQuery, ImplSelfTyQuery, ImplTraitQuery, + ImplsForTraitQuery, ImplsInCrateQuery, InternAssocTyValueQuery, InternChalkImplQuery, + InternTypeCtorQuery, StructDatumQuery, TraitDatumQuery, TraitSolveQuery, TraitSolverQuery, TyQuery, ValueTyQuery, }; -- cgit v1.2.3 From d3188769e41a051df7f02395b43f11e5cedede0b Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sat, 1 Feb 2020 22:13:02 +0200 Subject: Auto import functions --- crates/ra_hir/src/code_model.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 500b34c17..eaacf8c9e 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -119,7 +119,7 @@ impl_froms!( BuiltinType ); -pub use hir_def::{attr::Attrs, visibility::Visibility, AssocItemId}; +pub use hir_def::{attr::Attrs, item_scope::ItemInNs, visibility::Visibility, AssocItemId}; use rustc_hash::FxHashSet; impl Module { @@ -238,11 +238,16 @@ impl Module { item: ModuleDef, ) -> Option { // FIXME expose namespace choice - hir_def::find_path::find_path( - db, - hir_def::item_scope::ItemInNs::Types(item.into()), - self.into(), - ) + hir_def::find_path::find_path(db, determine_item_namespace(item), self.into()) + } +} + +fn determine_item_namespace(module_def: ModuleDef) -> ItemInNs { + match module_def { + ModuleDef::Static(_) | ModuleDef::Const(_) | ModuleDef::Function(_) => { + ItemInNs::Values(module_def.into()) + } + _ => ItemInNs::Types(module_def.into()), } } -- cgit v1.2.3 From 6dae5cbb1190cde6a20aa1758c7d87e84933378e Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sun, 2 Feb 2020 14:06:51 +0200 Subject: Require ModPath for importing --- crates/ra_hir/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs index 9e2673d13..64b55860d 100644 --- a/crates/ra_hir/src/lib.rs +++ b/crates/ra_hir/src/lib.rs @@ -59,6 +59,7 @@ pub use hir_def::{ ModuleDefId, // FIXME this is exposed and should be used for implementing the `TestImportsLocator` in `ra_assists` only, should be removed later along with the trait and the implementation. }; pub use hir_expand::{ - name::Name, HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Origin, + name::{known, Name}, + HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Origin, }; pub use hir_ty::{display::HirDisplay, CallableDef}; -- cgit v1.2.3 From c669b2f489cb551fbe53fd01f7532b5d55ffe704 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sun, 2 Feb 2020 14:27:52 +0200 Subject: Code review fixes --- crates/ra_hir/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs index 64b55860d..ea06a4a58 100644 --- a/crates/ra_hir/src/lib.rs +++ b/crates/ra_hir/src/lib.rs @@ -59,7 +59,7 @@ pub use hir_def::{ ModuleDefId, // FIXME this is exposed and should be used for implementing the `TestImportsLocator` in `ra_assists` only, should be removed later along with the trait and the implementation. }; pub use hir_expand::{ - name::{known, Name}, + name::{name, Name}, HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Origin, }; pub use hir_ty::{display::HirDisplay, CallableDef}; -- cgit v1.2.3 From f4a4fcf2753f48b81873de5dc39c1159d2a88654 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Thu, 6 Feb 2020 19:27:48 +0200 Subject: Remove the leftovers after ImportLocator removal --- crates/ra_hir/src/lib.rs | 1 - 1 file changed, 1 deletion(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs index ea06a4a58..86e422779 100644 --- a/crates/ra_hir/src/lib.rs +++ b/crates/ra_hir/src/lib.rs @@ -56,7 +56,6 @@ pub use hir_def::{ nameres::ModuleSource, path::{ModPath, Path, PathKind}, type_ref::Mutability, - ModuleDefId, // FIXME this is exposed and should be used for implementing the `TestImportsLocator` in `ra_assists` only, should be removed later along with the trait and the implementation. }; pub use hir_expand::{ name::{name, Name}, -- cgit v1.2.3 From 22a65b11b3a69b3dae561b34c6b28cb2107169d1 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 24 Jan 2020 14:32:47 +0100 Subject: Introduce TyLoweringContext --- crates/ra_hir/src/code_model.rs | 11 +++++++---- crates/ra_hir/src/source_analyzer.rs | 9 +++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index eaacf8c9e..837a3ed6d 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -733,7 +733,8 @@ impl Local { let ty = infer[self.pat_id].clone(); let resolver = def.resolver(db); let krate = def.module(db).krate; - let environment = TraitEnvironment::lower(db, &resolver); + let ctx = hir_ty::TyLoweringContext { db, resolver: &resolver }; + let environment = TraitEnvironment::lower(&ctx); Type { krate, ty: InEnvironment { value: ty, environment } } } @@ -789,8 +790,9 @@ impl ImplBlock { pub fn target_ty(&self, db: &impl HirDatabase) -> Type { let impl_data = db.impl_data(self.id); let resolver = self.id.resolver(db); - let environment = TraitEnvironment::lower(db, &resolver); - let ty = Ty::from_hir(db, &resolver, &impl_data.target_type); + let ctx = hir_ty::TyLoweringContext { db, resolver: &resolver }; + let environment = TraitEnvironment::lower(&ctx); + let ty = Ty::from_hir(&ctx, &impl_data.target_type); Type { krate: self.id.lookup(db).container.module(db).krate, ty: InEnvironment { value: ty, environment }, @@ -844,7 +846,8 @@ pub struct Type { impl Type { fn new(db: &impl HirDatabase, krate: CrateId, lexical_env: impl HasResolver, ty: Ty) -> Type { let resolver = lexical_env.resolver(db); - let environment = TraitEnvironment::lower(db, &resolver); + let ctx = hir_ty::TyLoweringContext { db, resolver: &resolver }; + let environment = TraitEnvironment::lower(&ctx); Type { krate, ty: InEnvironment { value: ty, environment } } } diff --git a/crates/ra_hir/src/source_analyzer.rs b/crates/ra_hir/src/source_analyzer.rs index 4f8fc9602..9cfd52856 100644 --- a/crates/ra_hir/src/source_analyzer.rs +++ b/crates/ra_hir/src/source_analyzer.rs @@ -178,6 +178,11 @@ impl SourceAnalyzer { } } + fn trait_env(&self, db: &impl HirDatabase) -> Arc { + let ctx = hir_ty::TyLoweringContext { db, resolver: &self.resolver }; + TraitEnvironment::lower(&ctx) + } + pub fn type_of(&self, db: &impl HirDatabase, expr: &ast::Expr) -> Option { let expr_id = if let Some(expr) = self.expand_expr(db, InFile::new(self.file_id, expr)) { self.body_source_map.as_ref()?.node_expr(expr.as_ref())? @@ -186,14 +191,14 @@ impl SourceAnalyzer { }; let ty = self.infer.as_ref()?[expr_id].clone(); - let environment = TraitEnvironment::lower(db, &self.resolver); + let environment = self.trait_env(db); Some(Type { krate: self.resolver.krate()?, ty: InEnvironment { value: ty, environment } }) } pub fn type_of_pat(&self, db: &impl HirDatabase, pat: &ast::Pat) -> Option { let pat_id = self.pat_id(pat)?; let ty = self.infer.as_ref()?[pat_id].clone(); - let environment = TraitEnvironment::lower(db, &self.resolver); + let environment = self.trait_env(db); Some(Type { krate: self.resolver.krate()?, ty: InEnvironment { value: ty, environment } }) } -- cgit v1.2.3 From 7ea4bce1b292d455c313f914b3aa3051293c502b Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 24 Jan 2020 15:22:00 +0100 Subject: Add impl trait lowering mode --- crates/ra_hir/src/code_model.rs | 14 ++++++++------ crates/ra_hir/src/source_analyzer.rs | 3 +-- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 837a3ed6d..fda31d517 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -733,8 +733,7 @@ impl Local { let ty = infer[self.pat_id].clone(); let resolver = def.resolver(db); let krate = def.module(db).krate; - let ctx = hir_ty::TyLoweringContext { db, resolver: &resolver }; - let environment = TraitEnvironment::lower(&ctx); + let environment = TraitEnvironment::lower(db, &resolver); Type { krate, ty: InEnvironment { value: ty, environment } } } @@ -790,8 +789,12 @@ impl ImplBlock { pub fn target_ty(&self, db: &impl HirDatabase) -> Type { let impl_data = db.impl_data(self.id); let resolver = self.id.resolver(db); - let ctx = hir_ty::TyLoweringContext { db, resolver: &resolver }; - let environment = TraitEnvironment::lower(&ctx); + let ctx = hir_ty::TyLoweringContext { + db, + resolver: &resolver, + impl_trait_mode: hir_ty::ImplTraitLoweringMode::Disallowed, + }; + let environment = TraitEnvironment::lower(db, &resolver); let ty = Ty::from_hir(&ctx, &impl_data.target_type); Type { krate: self.id.lookup(db).container.module(db).krate, @@ -846,8 +849,7 @@ pub struct Type { impl Type { fn new(db: &impl HirDatabase, krate: CrateId, lexical_env: impl HasResolver, ty: Ty) -> Type { let resolver = lexical_env.resolver(db); - let ctx = hir_ty::TyLoweringContext { db, resolver: &resolver }; - let environment = TraitEnvironment::lower(&ctx); + let environment = TraitEnvironment::lower(db, &resolver); Type { krate, ty: InEnvironment { value: ty, environment } } } diff --git a/crates/ra_hir/src/source_analyzer.rs b/crates/ra_hir/src/source_analyzer.rs index 9cfd52856..bb9a35c5d 100644 --- a/crates/ra_hir/src/source_analyzer.rs +++ b/crates/ra_hir/src/source_analyzer.rs @@ -179,8 +179,7 @@ impl SourceAnalyzer { } fn trait_env(&self, db: &impl HirDatabase) -> Arc { - let ctx = hir_ty::TyLoweringContext { db, resolver: &self.resolver }; - TraitEnvironment::lower(&ctx) + TraitEnvironment::lower(db, &self.resolver) } pub fn type_of(&self, db: &impl HirDatabase, expr: &ast::Expr) -> Option { -- cgit v1.2.3 From 93aa166748eef9560df2435391dc3f3b53f8262d Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 24 Jan 2020 19:35:09 +0100 Subject: wip lower impl trait to type args --- crates/ra_hir/src/code_model.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index fda31d517..817c27410 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -755,7 +755,7 @@ pub struct TypeParam { impl TypeParam { pub fn name(self, db: &impl HirDatabase) -> Name { let params = db.generic_params(self.id.parent); - params.types[self.id.local_id].name.clone() + params.types[self.id.local_id].name.clone().unwrap_or_else(Name::missing) } pub fn module(self, db: &impl HirDatabase) -> Module { -- cgit v1.2.3 From 0718682cffaae34e5c106c793c60f6706fc04b05 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Tue, 4 Feb 2020 21:33:03 +0100 Subject: Fix compilation of other crates --- crates/ra_hir/src/code_model.rs | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 817c27410..63c85ca34 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -13,6 +13,7 @@ use hir_def::{ AdtId, ConstId, DefWithBodyId, EnumId, FunctionId, HasModule, ImplId, LocalEnumVariantId, LocalModuleId, LocalStructFieldId, Lookup, ModuleId, StaticId, StructId, TraitId, TypeAliasId, TypeParamId, UnionId, + GenericDefId }; use hir_expand::{ diagnostics::DiagnosticSink, @@ -21,7 +22,8 @@ use hir_expand::{ }; use hir_ty::{ autoderef, display::HirFormatter, expr::ExprValidator, method_resolution, ApplicationTy, - Canonical, InEnvironment, TraitEnvironment, Ty, TyDefId, TypeCtor, TypeWalk, + Canonical, InEnvironment, TraitEnvironment, Ty, TyDefId, TypeCtor, + Substs }; use ra_db::{CrateId, Edition, FileId}; use ra_prof::profile; @@ -270,7 +272,13 @@ impl StructField { pub fn ty(&self, db: &impl HirDatabase) -> Type { let var_id = self.parent.into(); - let ty = db.field_types(var_id)[self.id].clone(); + let generic_def_id: GenericDefId = match self.parent { + VariantDef::Struct(it) => it.id.into(), + VariantDef::Union(it) => it.id.into(), + VariantDef::EnumVariant(it) => it.parent.id.into(), + }; + let substs = Substs::type_params(db, generic_def_id); + let ty = db.field_types(var_id)[self.id].clone().subst(&substs); Type::new(db, self.parent.module(db).id.krate.into(), var_id, ty) } @@ -789,11 +797,7 @@ impl ImplBlock { pub fn target_ty(&self, db: &impl HirDatabase) -> Type { let impl_data = db.impl_data(self.id); let resolver = self.id.resolver(db); - let ctx = hir_ty::TyLoweringContext { - db, - resolver: &resolver, - impl_trait_mode: hir_ty::ImplTraitLoweringMode::Disallowed, - }; + let ctx = hir_ty::TyLoweringContext::new(db, &resolver); let environment = TraitEnvironment::lower(db, &resolver); let ty = Ty::from_hir(&ctx, &impl_data.target_type); Type { @@ -856,9 +860,10 @@ impl Type { fn from_def( db: &impl HirDatabase, krate: CrateId, - def: impl HasResolver + Into, + def: impl HasResolver + Into + Into, ) -> Type { - let ty = db.ty(def.into()); + let substs = Substs::type_params(db, def); + let ty = db.ty(def.into()).subst(&substs); Type::new(db, krate, def, ty) } @@ -955,7 +960,7 @@ impl Type { match a_ty.ctor { TypeCtor::Tuple { .. } => { for ty in a_ty.parameters.iter() { - let ty = ty.clone().subst(&a_ty.parameters); + let ty = ty.clone(); res.push(self.derived(ty)); } } -- cgit v1.2.3 From dded90a748737c3661aad043524f2248e324c867 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 7 Feb 2020 15:13:15 +0100 Subject: Formatting --- crates/ra_hir/src/code_model.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 63c85ca34..4d9641728 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -10,10 +10,9 @@ use hir_def::{ per_ns::PerNs, resolver::HasResolver, type_ref::{Mutability, TypeRef}, - AdtId, ConstId, DefWithBodyId, EnumId, FunctionId, HasModule, ImplId, LocalEnumVariantId, - LocalModuleId, LocalStructFieldId, Lookup, ModuleId, StaticId, StructId, TraitId, TypeAliasId, - TypeParamId, UnionId, - GenericDefId + AdtId, ConstId, DefWithBodyId, EnumId, FunctionId, GenericDefId, HasModule, ImplId, + LocalEnumVariantId, LocalModuleId, LocalStructFieldId, Lookup, ModuleId, StaticId, StructId, + TraitId, TypeAliasId, TypeParamId, UnionId, }; use hir_expand::{ diagnostics::DiagnosticSink, @@ -22,8 +21,7 @@ use hir_expand::{ }; use hir_ty::{ autoderef, display::HirFormatter, expr::ExprValidator, method_resolution, ApplicationTy, - Canonical, InEnvironment, TraitEnvironment, Ty, TyDefId, TypeCtor, - Substs + Canonical, InEnvironment, Substs, TraitEnvironment, Ty, TyDefId, TypeCtor, }; use ra_db::{CrateId, Edition, FileId}; use ra_prof::profile; -- cgit v1.2.3 From 7de7c8a7efa7af2e3de3a401ea31fb26cad9649b Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sun, 9 Feb 2020 12:34:41 +0200 Subject: Remove ImportResolver-related stubs --- crates/ra_hir/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs index 86e422779..e1c7b7a20 100644 --- a/crates/ra_hir/src/lib.rs +++ b/crates/ra_hir/src/lib.rs @@ -58,7 +58,6 @@ pub use hir_def::{ type_ref::Mutability, }; pub use hir_expand::{ - name::{name, Name}, - HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Origin, + name::Name, HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Origin, }; pub use hir_ty::{display::HirDisplay, CallableDef}; -- cgit v1.2.3