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]
This commit is contained in:
Patrick Walton
2014-05-05 18:56:44 -07:00
parent 24f6f26e63
commit 090040bf40
495 changed files with 2252 additions and 1897 deletions

View File

@@ -227,6 +227,7 @@ use libc;
use ops::{BitOr, BitAnd, Sub};
use os;
use option::{Option, Some, None};
use owned::Box;
use path::Path;
use result::{Ok, Err, Result};
use str::StrSlice;
@@ -811,7 +812,7 @@ pub trait Reader {
}
}
impl Reader for ~Reader {
impl Reader for Box<Reader> {
fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> { self.read(buf) }
}
@@ -1052,7 +1053,7 @@ pub trait Writer {
}
}
impl Writer for ~Writer {
impl Writer for Box<Writer> {
fn write(&mut self, buf: &[u8]) -> IoResult<()> { self.write(buf) }
fn flush(&mut self) -> IoResult<()> { self.flush() }
}