Skip to content

Commit 9491dc3

Browse files
committed
---
yaml --- r: 48071 b: refs/heads/incoming c: d3b94f6 h: refs/heads/master i: 48069: cc8c121 48067: 77f2dc1 48063: 4dd6e8d v: v3
1 parent 48c2d21 commit 9491dc3

File tree

3 files changed

+23
-17
lines changed

3 files changed

+23
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: 2f901126d4c2c19334842e539561b15e7e74159d
9+
refs/heads/incoming: d3b94f6f341e935910aff59ea187af7b34055be8
1010
refs/heads/dist-snap: 8b98e5a296d95c5e832db0756828e5bec31c6f50
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libsyntax/print/pprust.rs

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -713,30 +713,26 @@ pub fn print_struct(s: @ps,
713713
ident: ast::ident,
714714
span: codemap::span) {
715715
print_ident(s, ident);
716-
nbsp(s);
717716
print_generics(s, generics);
718717
if ast_util::struct_def_is_tuple_like(struct_def) {
719-
popen(s);
720-
let mut first = true;
721-
for struct_def.fields.each |field| {
722-
if first {
723-
first = false;
724-
} else {
725-
word_space(s, ~",");
726-
}
727-
728-
match field.node.kind {
729-
ast::named_field(*) => fail!(~"unexpected named field"),
730-
ast::unnamed_field => {
731-
maybe_print_comment(s, field.span.lo);
732-
print_type(s, field.node.ty);
718+
if !struct_def.fields.is_empty() {
719+
popen(s);
720+
do commasep(s, inconsistent, struct_def.fields) |s, field| {
721+
match field.node.kind {
722+
ast::named_field(*) => fail!(~"unexpected named field"),
723+
ast::unnamed_field => {
724+
maybe_print_comment(s, field.span.lo);
725+
print_type(s, field.node.ty);
726+
}
733727
}
734728
}
729+
pclose(s);
735730
}
736-
pclose(s);
737731
word(s.s, ~";");
732+
end(s);
738733
end(s); // close the outer-box
739734
} else {
735+
nbsp(s);
740736
bopen(s);
741737
hardbreak_if_not_bol(s);
742738
do struct_def.dtor.iter |dtor| {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// pp-exact
2+
struct Foo;
3+
struct Bar(int, int);
4+
5+
fn main() {
6+
struct Foo2;
7+
struct Bar2(int, int, int);
8+
let a = Bar(5, 5);
9+
let b = Foo;
10+
}

0 commit comments

Comments
 (0)