summary refs log tree commit diff
path: root/src/libsyntax/print/pprust.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-05-05 18:56:44 -0700
committerPatrick Walton <pcwalton@mimiga.net>2014-05-06 23:12:54 -0700
commit090040bf4037a094e50b03d79e4baf5cd89c912b (patch)
tree27fa91d623889d59260d3db167abdfa8c4288849 /src/libsyntax/print/pprust.rs
parent24f6f26e633e50b5b59f9d0f6cca0b1e49e215d9 (diff)
downloadrust-090040bf4037a094e50b03d79e4baf5cd89c912b.tar.gz
rust-090040bf4037a094e50b03d79e4baf5cd89c912b.zip
librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, except
for `~str`/`~[]`.

Note that `~self` still remains, since I forgot to add support for
`Box<self>` before the snapshot.

How to update your code:

* Instead of `~EXPR`, you should write `box EXPR`.

* Instead of `~TYPE`, you should write `Box<Type>`.

* Instead of `~PATTERN`, you should write `box PATTERN`.

[breaking-change]
Diffstat (limited to 'src/libsyntax/print/pprust.rs')
-rw-r--r--src/libsyntax/print/pprust.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index fb823522612..310ca18e4fa 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -65,12 +65,12 @@ pub struct State<'a> {
     ann: &'a PpAnn
 }
 
-pub fn rust_printer(writer: ~io::Writer) -> State<'static> {
+pub fn rust_printer(writer: Box<io::Writer>) -> State<'static> {
     static NO_ANN: NoAnn = NoAnn;
     rust_printer_annotated(writer, &NO_ANN)
 }
 
-pub fn rust_printer_annotated<'a>(writer: ~io::Writer,
+pub fn rust_printer_annotated<'a>(writer: Box<io::Writer>,
                                   ann: &'a PpAnn) -> State<'a> {
     State {
         s: pp::mk_printer(writer, default_columns),
@@ -99,7 +99,7 @@ pub fn print_crate<'a>(cm: &'a CodeMap,
                        krate: &ast::Crate,
                        filename: ~str,
                        input: &mut io::Reader,
-                       out: ~io::Writer,
+                       out: Box<io::Writer>,
                        ann: &'a PpAnn,
                        is_expanded: bool) -> IoResult<()> {
     let (cmnts, lits) = comments::gather_comments_and_literals(
@@ -140,7 +140,7 @@ pub fn to_str(f: |&mut State| -> IoResult<()>) -> ~str {
         // FIXME(pcwalton): A nasty function to extract the string from an `io::Writer`
         // that we "know" to be a `MemWriter` that works around the lack of checked
         // downcasts.
-        let (_, wr): (uint, ~MemWriter) = cast::transmute_copy(&s.s.out);
+        let (_, wr): (uint, Box<MemWriter>) = cast::transmute_copy(&s.s.out);
         let result = str::from_utf8_owned(wr.get_ref().to_owned()).unwrap();
         cast::forget(wr);
         result
@@ -1113,7 +1113,7 @@ impl<'a> State<'a> {
 
     pub fn print_expr_vstore(&mut self, t: ast::ExprVstore) -> IoResult<()> {
         match t {
-            ast::ExprVstoreUniq => word(&mut self.s, "~"),
+            ast::ExprVstoreUniq => word(&mut self.s, "box "),
             ast::ExprVstoreSlice => word(&mut self.s, "&"),
             ast::ExprVstoreMutSlice => {
                 try!(word(&mut self.s, "&"));
@@ -1686,7 +1686,7 @@ impl<'a> State<'a> {
                 try!(self.pclose());
             }
             ast::PatUniq(inner) => {
-                try!(word(&mut self.s, "~"));
+                try!(word(&mut self.s, "box "));
                 try!(self.print_pat(inner));
             }
             ast::PatRegion(inner) => {