@@ -971,7 +971,7 @@ https://doc.rust-lang.org/reference/types.html#trait-objects");
971
971
self . field_ty ( span, f, substs)
972
972
} )
973
973
. unwrap_or_else ( || {
974
- inexistent_fields. push ( ( span , field. ident ) ) ;
974
+ inexistent_fields. push ( field. ident ) ;
975
975
no_field_errors = false ;
976
976
tcx. types . err
977
977
} )
@@ -987,24 +987,24 @@ https://doc.rust-lang.org/reference/types.html#trait-objects");
987
987
. collect :: < Vec < _ > > ( ) ;
988
988
if inexistent_fields. len ( ) > 0 {
989
989
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" , "" )
991
991
} else {
992
992
( format ! ( "fields named {}" ,
993
993
inexistent_fields. iter( )
994
- . map( |( _ , name ) | format!( "`{}`" , name ) )
994
+ . map( |ident | format!( "`{}`" , ident ) )
995
995
. collect:: <Vec <String >>( )
996
996
. join( ", " ) ) , "these" , "s" )
997
997
} ;
998
- let spans = inexistent_fields. iter ( ) . map ( |( span , _ ) | * span) . collect :: < Vec < _ > > ( ) ;
998
+ let spans = inexistent_fields. iter ( ) . map ( |ident| ident . span ) . collect :: < Vec < _ > > ( ) ;
999
999
let mut err = struct_span_err ! ( tcx. sess,
1000
1000
spans,
1001
1001
E0026 ,
1002
1002
"{} `{}` does not have {}" ,
1003
1003
kind_name,
1004
1004
tcx. item_path_str( variant. did) ,
1005
1005
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 ,
1008
1008
format ! ( "{} `{}` does not have {} field{}" ,
1009
1009
kind_name,
1010
1010
tcx. item_path_str( variant. did) ,
@@ -1016,8 +1016,8 @@ https://doc.rust-lang.org/reference/types.html#trait-objects");
1016
1016
find_best_match_for_name ( input, & ident. as_str ( ) , None ) ;
1017
1017
if let Some ( suggested_name) = suggested_name {
1018
1018
err. span_suggestion (
1019
- * span,
1020
- "did you mean " ,
1019
+ ident . span ,
1020
+ "a field with a similar name exists " ,
1021
1021
suggested_name. to_string ( ) ,
1022
1022
Applicability :: MaybeIncorrect ,
1023
1023
) ;
0 commit comments