Skip to content

Commit 5560f6d

Browse files
committed
Revert "Fix ast expanded printing for anonymous types"
This reverts commit 5b4bc05.
1 parent 2041fb1 commit 5560f6d

File tree

1 file changed

+10
-6
lines changed
  • compiler/rustc_ast_pretty/src/pprust

1 file changed

+10
-6
lines changed

compiler/rustc_ast_pretty/src/pprust/state.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -986,12 +986,12 @@ impl<'a> State<'a> {
986986
self.pclose();
987987
}
988988
ast::TyKind::AnonymousStruct(ref fields, ..) => {
989-
self.head("struct");
990-
self.print_record_struct_body(&fields, ty.span);
989+
self.s.word("struct");
990+
self.print_record_struct_body(fields, ty.span);
991991
}
992992
ast::TyKind::AnonymousUnion(ref fields, ..) => {
993-
self.head("union");
994-
self.print_record_struct_body(&fields, ty.span);
993+
self.s.word("union");
994+
self.print_record_struct_body(fields, ty.span);
995995
}
996996
ast::TyKind::Paren(ref typ) => {
997997
self.popen();
@@ -1413,7 +1413,12 @@ impl<'a> State<'a> {
14131413
}
14141414
}
14151415

1416-
crate fn print_record_struct_body(&mut self, fields: &[ast::FieldDef], span: rustc_span::Span) {
1416+
crate fn print_record_struct_body(
1417+
&mut self,
1418+
fields: &Vec<ast::FieldDef>,
1419+
span: rustc_span::Span,
1420+
) {
1421+
self.nbsp();
14171422
self.bopen();
14181423
self.hardbreak_if_not_bol();
14191424

@@ -1462,7 +1467,6 @@ impl<'a> State<'a> {
14621467
}
14631468
ast::VariantData::Struct(ref fields, ..) => {
14641469
self.print_where_clause(&generics.where_clause);
1465-
self.nbsp();
14661470
self.print_record_struct_body(fields, span);
14671471
}
14681472
}

0 commit comments

Comments
 (0)