@@ -1218,17 +1218,20 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1218
1218
match variant. ctor_kind {
1219
1219
CtorKind :: Fn => {
1220
1220
err. span_label ( field. ident . span , "field does not exist" ) ;
1221
- err. span_label (
1222
- field. ident . span ,
1223
- format ! ( "`{adt}` is a tuple {kind_name}, use the appropriate syntax: `{adt}(/* fields */)`" , adt=ty, kind_name=kind_name)
1224
- ) ;
1221
+ err. span_label ( field. ident . span , format ! (
1222
+ "`{adt}` is a tuple {kind_name}, use the appropriate syntax: `{adt}(/* fields */)`" ,
1223
+ adt=ty,
1224
+ kind_name=kind_name
1225
+ ) ) ;
1225
1226
}
1226
1227
_ => {
1227
1228
// prevent all specified fields from being suggested
1228
1229
let skip_fields = skip_fields. iter ( ) . map ( |ref x| x. ident . as_str ( ) ) ;
1229
- if let Some ( field_name) = Self :: suggest_field_name ( variant,
1230
- & field. ident . as_str ( ) ,
1231
- skip_fields. collect ( ) ) {
1230
+ if let Some ( field_name) = Self :: suggest_field_name (
1231
+ variant,
1232
+ & field. ident . as_str ( ) ,
1233
+ skip_fields. collect ( )
1234
+ ) {
1232
1235
err. span_suggestion (
1233
1236
field. ident . span ,
1234
1237
"a field with a similar name exists" ,
@@ -1239,12 +1242,16 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1239
1242
match ty. sty {
1240
1243
ty:: Adt ( adt, ..) => {
1241
1244
if adt. is_enum ( ) {
1242
- err. span_label ( field. ident . span ,
1243
- format ! ( "`{}::{}` does not have this field" ,
1244
- ty, variant. ident) ) ;
1245
+ err. span_label ( field. ident . span , format ! (
1246
+ "`{}::{}` does not have this field" ,
1247
+ ty,
1248
+ variant. ident
1249
+ ) ) ;
1245
1250
} else {
1246
- err. span_label ( field. ident . span ,
1247
- format ! ( "`{}` does not have this field" , ty) ) ;
1251
+ err. span_label ( field. ident . span , format ! (
1252
+ "`{}` does not have this field" ,
1253
+ ty
1254
+ ) ) ;
1248
1255
}
1249
1256
let available_field_names = self . available_field_names ( variant) ;
1250
1257
if !available_field_names. is_empty ( ) {
0 commit comments