Skip to content

Commit 0d7bef4

Browse files
committed
libsyntax: Fix wrong pretty printing of private fields
1 parent 9c6890f commit 0d7bef4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/libsyntax/print/pprust.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ fn print_item(s: ps, &&item: @ast::item) {
497497
print_enum_def(s, enum_definition, params, item.ident, item.span);
498498
}
499499
ast::item_class(struct_def, tps) => {
500-
head(s, ~"class");
500+
head(s, ~"struct");
501501
print_struct(s, struct_def, tps, item.ident, item.span);
502502
}
503503
ast::item_impl(tps, traits, ty, methods) => {
@@ -636,9 +636,7 @@ fn print_struct(s: ps, struct_def: @ast::struct_def, tps: ~[ast::ty_param],
636636
hardbreak_if_not_bol(s);
637637
maybe_print_comment(s, field.span.lo);
638638
if visibility == ast::private {
639-
head(s, ~"priv");
640-
bopen(s);
641-
hardbreak_if_not_bol(s);
639+
word_nbsp(s, ~"priv");
642640
}
643641
if mutability == ast::class_mutable {
644642
word_nbsp(s, ~"mut");

0 commit comments

Comments
 (0)