@@ -667,7 +667,7 @@ pub(crate) struct UnnecessaryQualification<'ra> {
667667}
668668
669669#[ derive( Default , Debug ) ]
670- struct DiagMetadata < ' ast > {
670+ pub ( crate ) struct DiagMetadata < ' ast > {
671671 /// The current trait's associated items' ident, used for diagnostic suggestions.
672672 current_trait_assoc_items : Option < & ' ast [ Box < AssocItem > ] > ,
673673
@@ -678,7 +678,7 @@ struct DiagMetadata<'ast> {
678678 current_self_item : Option < NodeId > ,
679679
680680 /// The current trait (used to suggest).
681- current_item : Option < & ' ast Item > ,
681+ pub ( crate ) current_item : Option < & ' ast Item > ,
682682
683683 /// When processing generic arguments and encountering an unresolved ident not found,
684684 /// suggest introducing a type or const param depending on the context.
@@ -885,6 +885,7 @@ impl<'ast, 'ra, 'tcx> Visitor<'ast> for LateResolutionVisitor<'_, 'ast, 'ra, 'tc
885885 TypeNS ,
886886 Some ( Finalize :: new ( ty. id , ty. span ) ) ,
887887 None ,
888+ None ,
888889 )
889890 . map_or ( Res :: Err , |d| d. res ( ) ) ;
890891 self . r . record_partial_res ( ty. id , PartialRes :: new ( res) ) ;
@@ -1457,6 +1458,7 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
14571458 None ,
14581459 & self . ribs [ ns] ,
14591460 None ,
1461+ None ,
14601462 )
14611463 }
14621464
@@ -1466,6 +1468,7 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
14661468 ns : Namespace ,
14671469 finalize : Option < Finalize > ,
14681470 ignore_binding : Option < NameBinding < ' ra > > ,
1471+ diag_metadata : Option < & crate :: late:: DiagMetadata < ' _ > > ,
14691472 ) -> Option < LexicalScopeBinding < ' ra > > {
14701473 self . r . resolve_ident_in_lexical_scope (
14711474 ident,
@@ -1474,6 +1477,7 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
14741477 finalize,
14751478 & self . ribs [ ns] ,
14761479 ignore_binding,
1480+ diag_metadata,
14771481 )
14781482 }
14791483
@@ -1493,6 +1497,7 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
14931497 Some ( & self . ribs ) ,
14941498 None ,
14951499 None ,
1500+ Some ( & self . diag_metadata ) ,
14961501 )
14971502 }
14981503
@@ -2551,8 +2556,8 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
25512556 report_error ( self , ns) ;
25522557 }
25532558 Some ( LexicalScopeBinding :: Item ( binding) ) => {
2554- if let Some ( LexicalScopeBinding :: Res ( ..) ) =
2555- self . resolve_ident_in_lexical_scope ( ident, ns, None , Some ( binding) )
2559+ if let Some ( LexicalScopeBinding :: Res ( ..) ) = self
2560+ . resolve_ident_in_lexical_scope ( ident, ns, None , Some ( binding) , None )
25562561 {
25572562 report_error ( self , ns) ;
25582563 }
@@ -5105,7 +5110,7 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
51055110 // use the type namespace
51065111 let ns = if i + 1 == path. len ( ) { ns } else { TypeNS } ;
51075112 let res = self . r . partial_res_map . get ( & seg. id ?) ?. full_res ( ) ?;
5108- let binding = self . resolve_ident_in_lexical_scope ( seg. ident , ns, None , None ) ?;
5113+ let binding = self . resolve_ident_in_lexical_scope ( seg. ident , ns, None , None , None ) ?;
51095114 ( res == binding. res ( ) ) . then_some ( ( seg, binding) )
51105115 } ) ;
51115116
0 commit comments