diff options
Diffstat (limited to 'crates/hir/src')
-rw-r--r-- | crates/hir/src/lib.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index 68ac8400c..0bb3767c1 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()), |
@@ -2199,6 +2200,7 @@ impl Type { | |||
2199 | name: Option<&Name>, | 2200 | name: Option<&Name>, |
2200 | mut callback: impl FnMut(&Ty, Function) -> Option<T>, | 2201 | mut callback: impl FnMut(&Ty, Function) -> Option<T>, |
2201 | ) -> Option<T> { | 2202 | ) -> Option<T> { |
2203 | let _p = profile::span("iterate_method_candidates"); | ||
2202 | // There should be no inference vars in types passed here | 2204 | // There should be no inference vars in types passed here |
2203 | // FIXME check that? | 2205 | // FIXME check that? |
2204 | // FIXME replace Unknown by bound vars here | 2206 | // FIXME replace Unknown by bound vars here |
@@ -2232,6 +2234,7 @@ impl Type { | |||
2232 | name: Option<&Name>, | 2234 | name: Option<&Name>, |
2233 | mut callback: impl FnMut(&Ty, AssocItem) -> Option<T>, | 2235 | mut callback: impl FnMut(&Ty, AssocItem) -> Option<T>, |
2234 | ) -> Option<T> { | 2236 | ) -> Option<T> { |
2237 | let _p = profile::span("iterate_path_candidates"); | ||
2235 | let canonical = hir_ty::replace_errors_with_variables(&self.ty); | 2238 | let canonical = hir_ty::replace_errors_with_variables(&self.ty); |
2236 | 2239 | ||
2237 | let env = self.env.clone(); | 2240 | let env = self.env.clone(); |
@@ -2269,6 +2272,7 @@ impl Type { | |||
2269 | &'a self, | 2272 | &'a self, |
2270 | db: &'a dyn HirDatabase, | 2273 | db: &'a dyn HirDatabase, |
2271 | ) -> impl Iterator<Item = Trait> + 'a { | 2274 | ) -> impl Iterator<Item = Trait> + 'a { |
2275 | let _p = profile::span("applicable_inherent_traits"); | ||
2272 | self.autoderef(db) | 2276 | self.autoderef(db) |
2273 | .filter_map(|derefed_type| derefed_type.ty.dyn_trait()) | 2277 | .filter_map(|derefed_type| derefed_type.ty.dyn_trait()) |
2274 | .flat_map(move |dyn_trait_id| hir_ty::all_super_traits(db.upcast(), dyn_trait_id)) | 2278 | .flat_map(move |dyn_trait_id| hir_ty::all_super_traits(db.upcast(), dyn_trait_id)) |