File tree Expand file tree Collapse file tree 3 files changed +23
-17
lines changed Expand file tree Collapse file tree 3 files changed +23
-17
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9
- refs/heads/incoming: 2f901126d4c2c19334842e539561b15e7e74159d
9
+ refs/heads/incoming: d3b94f6f341e935910aff59ea187af7b34055be8
10
10
refs/heads/dist-snap: 8b98e5a296d95c5e832db0756828e5bec31c6f50
11
11
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
12
12
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -713,30 +713,26 @@ pub fn print_struct(s: @ps,
713
713
ident: ast::ident,
714
714
span: codemap::span) {
715
715
print_ident(s, ident);
716
- nbsp(s);
717
716
print_generics(s, generics);
718
717
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
+ }
733
727
}
734
728
}
729
+ pclose(s);
735
730
}
736
- pclose(s);
737
731
word(s.s, ~" ; ");
732
+ end(s);
738
733
end(s); // close the outer-box
739
734
} else {
735
+ nbsp(s);
740
736
bopen(s);
741
737
hardbreak_if_not_bol(s);
742
738
do struct_def.dtor.iter |dtor| {
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments