aboutsummaryrefslogtreecommitdiff
path: root/crates/hir/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir/src')
-rw-r--r--crates/hir/src/lib.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index dba46df04..b9c1dc44d 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -191,6 +191,7 @@ impl Crate {
191 db: &dyn DefDatabase, 191 db: &dyn DefDatabase,
192 query: import_map::Query, 192 query: import_map::Query,
193 ) -> impl Iterator<Item = Either<ModuleDef, MacroDef>> { 193 ) -> impl Iterator<Item = Either<ModuleDef, MacroDef>> {
194 let _p = profile::span("query_external_importables");
194 import_map::search_dependencies(db, self.into(), query).into_iter().map(|item| match item { 195 import_map::search_dependencies(db, self.into(), query).into_iter().map(|item| match item {
195 ItemInNs::Types(mod_id) | ItemInNs::Values(mod_id) => Either::Left(mod_id.into()), 196 ItemInNs::Types(mod_id) | ItemInNs::Values(mod_id) => Either::Left(mod_id.into()),
196 ItemInNs::Macros(mac_id) => Either::Right(mac_id.into()), 197 ItemInNs::Macros(mac_id) => Either::Right(mac_id.into()),
@@ -1344,6 +1345,7 @@ impl MacroDef {
1344 MacroDefKind::Declarative(_) => MacroKind::Declarative, 1345 MacroDefKind::Declarative(_) => MacroKind::Declarative,
1345 MacroDefKind::BuiltIn(_, _) | MacroDefKind::BuiltInEager(_, _) => MacroKind::BuiltIn, 1346 MacroDefKind::BuiltIn(_, _) | MacroDefKind::BuiltInEager(_, _) => MacroKind::BuiltIn,
1346 MacroDefKind::BuiltInDerive(_, _) => MacroKind::Derive, 1347 MacroDefKind::BuiltInDerive(_, _) => MacroKind::Derive,
1348 MacroDefKind::BuiltInAttr(_, _) => MacroKind::Attr,
1347 MacroDefKind::ProcMacro(_, base_db::ProcMacroKind::CustomDerive, _) => { 1349 MacroDefKind::ProcMacro(_, base_db::ProcMacroKind::CustomDerive, _) => {
1348 MacroKind::Derive 1350 MacroKind::Derive
1349 } 1351 }
@@ -2184,6 +2186,7 @@ impl Type {
2184 name: Option<&Name>, 2186 name: Option<&Name>,
2185 mut callback: impl FnMut(&Ty, Function) -> Option<T>, 2187 mut callback: impl FnMut(&Ty, Function) -> Option<T>,
2186 ) -> Option<T> { 2188 ) -> Option<T> {
2189 let _p = profile::span("iterate_method_candidates");
2187 // There should be no inference vars in types passed here 2190 // There should be no inference vars in types passed here
2188 // FIXME check that? 2191 // FIXME check that?
2189 // FIXME replace Unknown by bound vars here 2192 // FIXME replace Unknown by bound vars here
@@ -2217,6 +2220,7 @@ impl Type {
2217 name: Option<&Name>, 2220 name: Option<&Name>,
2218 mut callback: impl FnMut(&Ty, AssocItem) -> Option<T>, 2221 mut callback: impl FnMut(&Ty, AssocItem) -> Option<T>,
2219 ) -> Option<T> { 2222 ) -> Option<T> {
2223 let _p = profile::span("iterate_path_candidates");
2220 let canonical = hir_ty::replace_errors_with_variables(&self.ty); 2224 let canonical = hir_ty::replace_errors_with_variables(&self.ty);
2221 2225
2222 let env = self.env.clone(); 2226 let env = self.env.clone();
@@ -2254,6 +2258,7 @@ impl Type {
2254 &'a self, 2258 &'a self,
2255 db: &'a dyn HirDatabase, 2259 db: &'a dyn HirDatabase,
2256 ) -> impl Iterator<Item = Trait> + 'a { 2260 ) -> impl Iterator<Item = Trait> + 'a {
2261 let _p = profile::span("applicable_inherent_traits");
2257 self.autoderef(db) 2262 self.autoderef(db)
2258 .filter_map(|derefed_type| derefed_type.ty.dyn_trait()) 2263 .filter_map(|derefed_type| derefed_type.ty.dyn_trait())
2259 .flat_map(move |dyn_trait_id| hir_ty::all_super_traits(db.upcast(), dyn_trait_id)) 2264 .flat_map(move |dyn_trait_id| hir_ty::all_super_traits(db.upcast(), dyn_trait_id))