@@ -452,7 +452,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
452452 }
453453
454454 self . suggest_self_or_self_ref ( & mut err, path, span) ;
455- self . detect_assoct_type_constraint_meant_as_path ( & mut err, & base_error) ;
455+ self . detect_assoc_type_constraint_meant_as_path ( & mut err, & base_error) ;
456456 if self . suggest_self_ty ( & mut err, source, path, span)
457457 || self . suggest_self_value ( & mut err, source, path, span)
458458 {
@@ -491,7 +491,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
491491 ( err, candidates)
492492 }
493493
494- fn detect_assoct_type_constraint_meant_as_path (
494+ fn detect_assoc_type_constraint_meant_as_path (
495495 & self ,
496496 err : & mut Diagnostic ,
497497 base_error : & BaseError ,
@@ -799,17 +799,19 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
799799 false ,
800800 ) = ( source, res, is_macro)
801801 {
802- if let Some ( bounds @ [ _, .., _] ) = self . diagnostic_metadata . current_trait_object {
802+ if let Some ( bounds @ [ first_bound, .., last_bound] ) =
803+ self . diagnostic_metadata . current_trait_object
804+ {
803805 fallback = true ;
804806 let spans: Vec < Span > = bounds
805807 . iter ( )
806808 . map ( |bound| bound. span ( ) )
807809 . filter ( |& sp| sp != base_error. span )
808810 . collect ( ) ;
809811
810- let start_span = bounds [ 0 ] . span ( ) ;
812+ let start_span = first_bound . span ( ) ;
811813 // `end_span` is the end of the poly trait ref (Foo + 'baz + Bar><)
812- let end_span = bounds . last ( ) . unwrap ( ) . span ( ) ;
814+ let end_span = last_bound . span ( ) ;
813815 // `last_bound_span` is the last bound of the poly trait ref (Foo + >'baz< + Bar)
814816 let last_bound_span = spans. last ( ) . cloned ( ) . unwrap ( ) ;
815817 let mut multi_span: MultiSpan = spans. clone ( ) . into ( ) ;
@@ -2419,10 +2421,10 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
24192421 let mut iter = ident. chars ( ) . map ( |c| c. is_uppercase ( ) ) ;
24202422 let single_uppercase_char =
24212423 matches ! ( iter. next( ) , Some ( true ) ) && matches ! ( iter. next( ) , None ) ;
2422- if !self . diagnostic_metadata . currently_processing_generics && !single_uppercase_char {
2424+ if !self . diagnostic_metadata . currently_processing_generic_args && !single_uppercase_char {
24232425 return None ;
24242426 }
2425- match ( self . diagnostic_metadata . current_item , single_uppercase_char, self . diagnostic_metadata . currently_processing_generics ) {
2427+ match ( self . diagnostic_metadata . current_item , single_uppercase_char, self . diagnostic_metadata . currently_processing_generic_args ) {
24262428 ( Some ( Item { kind : ItemKind :: Fn ( ..) , ident, .. } ) , _, _) if ident. name == sym:: main => {
24272429 // Ignore `fn main()` as we don't want to suggest `fn main<T>()`
24282430 }
0 commit comments