@@ -1218,17 +1218,20 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
12181218 match variant. ctor_kind {
12191219 CtorKind :: Fn => {
12201220 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+ ) ) ;
12251226 }
12261227 _ => {
12271228 // prevent all specified fields from being suggested
12281229 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+ ) {
12321235 err. span_suggestion (
12331236 field. ident . span ,
12341237 "a field with a similar name exists" ,
@@ -1239,12 +1242,16 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
12391242 match ty. sty {
12401243 ty:: Adt ( adt, ..) => {
12411244 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+ ) ) ;
12451250 } 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+ ) ) ;
12481255 }
12491256 let available_field_names = self . available_field_names ( variant) ;
12501257 if !available_field_names. is_empty ( ) {
0 commit comments