diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2014-12-19 11:47:48 +1300 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2014-12-30 13:06:25 +1300 |
| commit | 4e2afb0052618ca3d758fffd0cf50559be774391 (patch) | |
| tree | 1d15ea3b8b2c53b1e8f1599578325af3840edc04 /src/libsyntax/print | |
| parent | ed8f5039115308ca9d5591126e4d8a77864d4730 (diff) | |
| download | rust-4e2afb0052618ca3d758fffd0cf50559be774391.tar.gz rust-4e2afb0052618ca3d758fffd0cf50559be774391.zip | |
Remove ExprSlice by hacking the compiler
[breaking-change] The `mut` in slices is now redundant. Mutability is 'inferred' from position. This means that if mutability is only obvious from the type, you will need to use explicit calls to the slicing methods.
Diffstat (limited to 'src/libsyntax/print')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index a4b349c5f23..accffbc35ba 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1739,15 +1739,7 @@ impl<'a> State<'a> { try!(self.print_expr(&**index)); try!(word(&mut self.s, "]")); } - ast::ExprSlice(ref e, ref start, ref end, ref mutbl) => { - try!(self.print_expr(&**e)); - try!(word(&mut self.s, "[")); - if mutbl == &ast::MutMutable { - try!(word(&mut self.s, "mut")); - if start.is_some() || end.is_some() { - try!(space(&mut self.s)); - } - } + ast::ExprRange(ref start, ref end) => { if let &Some(ref e) = start { try!(self.print_expr(&**e)); } @@ -1757,16 +1749,6 @@ impl<'a> State<'a> { if let &Some(ref e) = end { try!(self.print_expr(&**e)); } - try!(word(&mut self.s, "]")); - } - ast::ExprRange(ref start, ref end) => { - if let &Some(ref e) = start { - try!(self.print_expr(&**e)); - } - try!(word(&mut self.s, "..")); - if let &Some(ref e) = end { - try!(self.print_expr(&**e)); - } } ast::ExprPath(ref path) => try!(self.print_path(path, true)), ast::ExprBreak(opt_ident) => { |
