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 2
2
refs/heads/master: 3bbcac322669cff3abde5be937cc4ec3860f3985
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
5
- refs/heads/try: 2f901126d4c2c19334842e539561b15e7e74159d
5
+ refs/heads/try: d3b94f6f341e935910aff59ea187af7b34055be8
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
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