@@ -244,6 +244,7 @@ impl<'a> ImportAssets<'a> {
244
244
prefixed : Option < PrefixKind > ,
245
245
defs_for_candidate_name : impl Iterator < Item = Either < ModuleDef , MacroDef > > ,
246
246
) -> FxHashSet < LocatedImport > {
247
+ let _p = profile:: span ( "import_assets::applicable_defs" ) ;
247
248
let current_crate = self . module_with_candidate . krate ( ) ;
248
249
249
250
let mod_path = |item| get_mod_path ( db, item, & self . module_with_candidate , prefixed) ;
@@ -278,6 +279,8 @@ fn path_applicable_imports(
278
279
mod_path : impl Fn ( ItemInNs ) -> Option < ModPath > + Copy ,
279
280
defs_for_candidate_name : impl Iterator < Item = Either < ModuleDef , MacroDef > > ,
280
281
) -> FxHashSet < LocatedImport > {
282
+ let _p = profile:: span ( "import_assets::path_applicable_imports" ) ;
283
+
281
284
let items_for_candidate_name =
282
285
defs_for_candidate_name. map ( |def| def. either ( ItemInNs :: from, ItemInNs :: from) ) ;
283
286
@@ -306,6 +309,7 @@ fn import_for_item(
306
309
unresolved_qualifier : & str ,
307
310
original_item : ItemInNs ,
308
311
) -> Option < LocatedImport > {
312
+ let _p = profile:: span ( "import_assets::import_for_item" ) ;
309
313
let ( item_candidate, trait_to_import) = match original_item. as_module_def_id ( ) {
310
314
Some ( module_def_id) => {
311
315
match ModuleDef :: from ( module_def_id) . as_assoc_item ( db) . map ( |assoc| assoc. container ( db) )
@@ -397,6 +401,7 @@ fn trait_applicable_items(
397
401
mod_path : impl Fn ( ItemInNs ) -> Option < ModPath > ,
398
402
defs_for_candidate_name : impl Iterator < Item = Either < ModuleDef , MacroDef > > ,
399
403
) -> FxHashSet < LocatedImport > {
404
+ let _p = profile:: span ( "import_assets::trait_applicable_items" ) ;
400
405
let mut required_assoc_items = FxHashSet :: default ( ) ;
401
406
402
407
let trait_candidates = defs_for_candidate_name
0 commit comments