From eb678ff87f0cdbf523b26fe9255cff684b4091e5 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Sat, 6 Sep 2014 15:23:55 -0700 Subject: librustc: Change the syntax of subslice matching to use postfix `..` instead of prefix `..`. This breaks code that looked like: match foo { [ first, ..middle, last ] => { ... } } Change this code to: match foo { [ first, middle.., last ] => { ... } } RFC #55. Closes #16967. [breaking-change] --- src/libsyntax/print/pprust.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libsyntax/print') diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index d5bc1bfe956..eaeb6aaab8a 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1912,13 +1912,13 @@ impl<'a> State<'a> { |s, p| s.print_pat(&**p))); for p in slice.iter() { if !before.is_empty() { try!(self.word_space(",")); } + try!(self.print_pat(&**p)); match **p { ast::Pat { node: ast::PatWild(ast::PatWildMulti), .. } => { // this case is handled by print_pat } _ => try!(word(&mut self.s, "..")), } - try!(self.print_pat(&**p)); if !after.is_empty() { try!(self.word_space(",")); } } try!(self.commasep(Inconsistent, -- cgit 1.4.1-3-g733a5