22
33use std:: sync:: Arc ;
44
5- use hir_expand:: { name:: Name , AstId , ExpandResult , HirFileId , MacroCallId , MacroDefKind , InFile } ;
5+ use hir_expand:: { name:: Name , AstId , ExpandResult , HirFileId , InFile , MacroCallId , MacroDefKind } ;
66use smallvec:: SmallVec ;
77use syntax:: ast;
88
@@ -12,7 +12,10 @@ use crate::{
1212 db:: DefDatabase ,
1313 intern:: Interned ,
1414 item_tree:: { self , AssocItem , FnFlags , ItemTree , ItemTreeId , ModItem , Param , TreeId } ,
15- nameres:: { attr_resolution:: ResolvedAttr , proc_macro:: ProcMacroKind , DefMap , diagnostics:: DefDiagnostic } ,
15+ nameres:: {
16+ attr_resolution:: ResolvedAttr , diagnostics:: DefDiagnostic , proc_macro:: ProcMacroKind ,
17+ DefMap ,
18+ } ,
1619 type_ref:: { TraitRef , TypeBound , TypeRef } ,
1720 visibility:: RawVisibility ,
1821 AssocItemId , AstIdWithPath , ConstId , ConstLoc , FunctionId , FunctionLoc , HasModule , ImplId ,
@@ -213,7 +216,10 @@ impl TraitData {
213216 db. trait_data_with_diagnostics ( tr) . 0
214217 }
215218
216- pub ( crate ) fn trait_data_with_diagnostics_query ( db : & dyn DefDatabase , tr : TraitId ) -> ( Arc < TraitData > , Arc < Vec < DefDiagnostic > > ) {
219+ pub ( crate ) fn trait_data_with_diagnostics_query (
220+ db : & dyn DefDatabase ,
221+ tr : TraitId ,
222+ ) -> ( Arc < TraitData > , Arc < Vec < DefDiagnostic > > ) {
217223 let tr_loc @ ItemLoc { container : module_id, id : tree_id } = tr. lookup ( db) ;
218224 let item_tree = tree_id. item_tree ( db) ;
219225 let tr_def = & item_tree[ tree_id. value ] ;
@@ -245,7 +251,7 @@ impl TraitData {
245251 visibility,
246252 skip_array_during_method_dispatch,
247253 } ) ,
248- Arc :: new ( diagnostics)
254+ Arc :: new ( diagnostics) ,
249255 )
250256 }
251257
@@ -290,7 +296,10 @@ impl ImplData {
290296 db. impl_data_with_diagnostics ( id) . 0
291297 }
292298
293- pub ( crate ) fn impl_data_with_diagnostics_query ( db : & dyn DefDatabase , id : ImplId ) -> ( Arc < ImplData > , Arc < Vec < DefDiagnostic > > ) {
299+ pub ( crate ) fn impl_data_with_diagnostics_query (
300+ db : & dyn DefDatabase ,
301+ id : ImplId ,
302+ ) -> ( Arc < ImplData > , Arc < Vec < DefDiagnostic > > ) {
294303 let _p = profile:: span ( "impl_data_with_diagnostics_query" ) ;
295304 let ItemLoc { container : module_id, id : tree_id } = id. lookup ( db) ;
296305
@@ -307,7 +316,10 @@ impl ImplData {
307316 let ( items, attribute_calls, diagnostics) = collector. finish ( ) ;
308317 let items = items. into_iter ( ) . map ( |( _, item) | item) . collect ( ) ;
309318
310- ( Arc :: new ( ImplData { target_trait, self_ty, items, is_negative, attribute_calls } ) , Arc :: new ( diagnostics) )
319+ (
320+ Arc :: new ( ImplData { target_trait, self_ty, items, is_negative, attribute_calls } ) ,
321+ Arc :: new ( diagnostics) ,
322+ )
311323 }
312324
313325 pub fn attribute_calls ( & self ) -> impl Iterator < Item = ( AstId < ast:: Item > , MacroCallId ) > + ' _ {
@@ -477,11 +489,15 @@ impl<'a> AssocItemCollector<'a> {
477489
478490 fn finish (
479491 self ,
480- ) -> ( Vec < ( Name , AssocItemId ) > , Option < Box < Vec < ( AstId < ast:: Item > , MacroCallId ) > > > , Vec < DefDiagnostic > ) {
492+ ) -> (
493+ Vec < ( Name , AssocItemId ) > ,
494+ Option < Box < Vec < ( AstId < ast:: Item > , MacroCallId ) > > > ,
495+ Vec < DefDiagnostic > ,
496+ ) {
481497 (
482498 self . items ,
483499 if self . attr_calls . is_empty ( ) { None } else { Some ( Box :: new ( self . attr_calls ) ) } ,
484- self . inactive_diagnostics
500+ self . inactive_diagnostics ,
485501 )
486502 }
487503
@@ -497,7 +513,7 @@ impl<'a> AssocItemCollector<'a> {
497513 self . module_id . local_id ,
498514 InFile :: new ( self . expander . current_file_id ( ) , item. ast_id ( & item_tree) . upcast ( ) ) ,
499515 attrs. cfg ( ) . unwrap ( ) ,
500- self . expander . cfg_options ( ) . clone ( )
516+ self . expander . cfg_options ( ) . clone ( ) ,
501517 ) ) ;
502518 continue ;
503519 }
0 commit comments