@@ -971,7 +971,7 @@ https://doc.rust-lang.org/reference/types.html#trait-objects");
971971 self . field_ty ( span, f, substs)
972972 } )
973973 . unwrap_or_else ( || {
974- inexistent_fields. push ( ( span , field. ident ) ) ;
974+ inexistent_fields. push ( field. ident ) ;
975975 no_field_errors = false ;
976976 tcx. types . err
977977 } )
@@ -987,24 +987,24 @@ https://doc.rust-lang.org/reference/types.html#trait-objects");
987987 . collect :: < Vec < _ > > ( ) ;
988988 if inexistent_fields. len ( ) > 0 {
989989 let ( field_names, t, plural) = if inexistent_fields. len ( ) == 1 {
990- ( format ! ( "a field named `{}`" , inexistent_fields[ 0 ] . 1 ) , "this" , "" )
990+ ( format ! ( "a field named `{}`" , inexistent_fields[ 0 ] ) , "this" , "" )
991991 } else {
992992 ( format ! ( "fields named {}" ,
993993 inexistent_fields. iter( )
994- . map( |( _ , name ) | format!( "`{}`" , name ) )
994+ . map( |ident | format!( "`{}`" , ident ) )
995995 . collect:: <Vec <String >>( )
996996 . join( ", " ) ) , "these" , "s" )
997997 } ;
998- let spans = inexistent_fields. iter ( ) . map ( |( span , _ ) | * span) . collect :: < Vec < _ > > ( ) ;
998+ let spans = inexistent_fields. iter ( ) . map ( |ident| ident . span ) . collect :: < Vec < _ > > ( ) ;
999999 let mut err = struct_span_err ! ( tcx. sess,
10001000 spans,
10011001 E0026 ,
10021002 "{} `{}` does not have {}" ,
10031003 kind_name,
10041004 tcx. item_path_str( variant. did) ,
10051005 field_names) ;
1006- if let Some ( ( span , ident) ) = inexistent_fields. last ( ) {
1007- err. span_label ( * span,
1006+ if let Some ( ident) = inexistent_fields. last ( ) {
1007+ err. span_label ( ident . span ,
10081008 format ! ( "{} `{}` does not have {} field{}" ,
10091009 kind_name,
10101010 tcx. item_path_str( variant. did) ,
@@ -1016,8 +1016,8 @@ https://doc.rust-lang.org/reference/types.html#trait-objects");
10161016 find_best_match_for_name ( input, & ident. as_str ( ) , None ) ;
10171017 if let Some ( suggested_name) = suggested_name {
10181018 err. span_suggestion (
1019- * span,
1020- "did you mean " ,
1019+ ident . span ,
1020+ "a field with a similar name exists " ,
10211021 suggested_name. to_string ( ) ,
10221022 Applicability :: MaybeIncorrect ,
10231023 ) ;
0 commit comments