diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-03-04 16:11:30 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-03-05 10:18:35 -0800 |
| commit | 6d4ed5283c53d975af9ff8f1a21fbc27eac9d4c1 (patch) | |
| tree | 3ee1c6be00c4c215de603c631a9a258a196a76cf /src/libsyntax | |
| parent | 5f55a070757792475a325dfd1786765b7bfc84f5 (diff) | |
| download | rust-6d4ed5283c53d975af9ff8f1a21fbc27eac9d4c1.tar.gz rust-6d4ed5283c53d975af9ff8f1a21fbc27eac9d4c1.zip | |
libsyntax: Separate multiple inherited traits with `+`
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index dd179171fce..5013b2c919f 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3112,7 +3112,7 @@ pub impl Parser { fn parse_trait_ref_list(&self, ket: &token::Token) -> ~[@trait_ref] { self.parse_seq_to_before_end( ket, - seq_sep_none(), + seq_sep_trailing_disallowed(token::BINOP(token::PLUS)), |p| p.parse_trait_ref() ) } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 735344e43be..d307e3964e7 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -600,8 +600,11 @@ pub fn print_item(s: @ps, &&item: @ast::item) { print_generics(s, generics); if traits.len() != 0u { word(s.s, ~":"); - for traits.each |trait_| { + for traits.eachi |i, trait_| { nbsp(s); + if i != 0 { + word_space(s, ~"+"); + } print_path(s, trait_.path, false); } } |
