@@ -452,7 +452,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
452
452
}
453
453
454
454
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) ;
456
456
if self . suggest_self_ty ( & mut err, source, path, span)
457
457
|| self . suggest_self_value ( & mut err, source, path, span)
458
458
{
@@ -491,7 +491,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
491
491
( err, candidates)
492
492
}
493
493
494
- fn detect_assoct_type_constraint_meant_as_path (
494
+ fn detect_assoc_type_constraint_meant_as_path (
495
495
& self ,
496
496
err : & mut Diagnostic ,
497
497
base_error : & BaseError ,
@@ -799,17 +799,19 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
799
799
false ,
800
800
) = ( source, res, is_macro)
801
801
{
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
+ {
803
805
fallback = true ;
804
806
let spans: Vec < Span > = bounds
805
807
. iter ( )
806
808
. map ( |bound| bound. span ( ) )
807
809
. filter ( |& sp| sp != base_error. span )
808
810
. collect ( ) ;
809
811
810
- let start_span = bounds [ 0 ] . span ( ) ;
812
+ let start_span = first_bound . span ( ) ;
811
813
// `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 ( ) ;
813
815
// `last_bound_span` is the last bound of the poly trait ref (Foo + >'baz< + Bar)
814
816
let last_bound_span = spans. last ( ) . cloned ( ) . unwrap ( ) ;
815
817
let mut multi_span: MultiSpan = spans. clone ( ) . into ( ) ;
@@ -2419,10 +2421,10 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
2419
2421
let mut iter = ident. chars ( ) . map ( |c| c. is_uppercase ( ) ) ;
2420
2422
let single_uppercase_char =
2421
2423
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 {
2423
2425
return None ;
2424
2426
}
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 ) {
2426
2428
( Some ( Item { kind : ItemKind :: Fn ( ..) , ident, .. } ) , _, _) if ident. name == sym:: main => {
2427
2429
// Ignore `fn main()` as we don't want to suggest `fn main<T>()`
2428
2430
}
0 commit comments