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

@@ -144,8 +144,10 @@ impl rtio::RtioPipe for UnixStream {
}
}
fn clone(&self) -> ~rtio::RtioPipe:Send {
box UnixStream { inner: self.inner.clone() } as ~rtio::RtioPipe:Send
fn clone(&self) -> Box<rtio::RtioPipe:Send> {
box UnixStream {
inner: self.inner.clone(),
} as Box<rtio::RtioPipe:Send>
}
}
@@ -176,8 +178,10 @@ impl UnixListener {
}
impl rtio::RtioUnixListener for UnixListener {
fn listen(~self) -> IoResult<~rtio::RtioUnixAcceptor:Send> {
self.native_listen(128).map(|a| box a as ~rtio::RtioUnixAcceptor:Send)
fn listen(~self) -> IoResult<Box<rtio::RtioUnixAcceptor:Send>> {
self.native_listen(128).map(|a| {
box a as Box<rtio::RtioUnixAcceptor:Send>
})
}
}
@@ -209,8 +213,8 @@ impl UnixAcceptor {
}
impl rtio::RtioUnixAcceptor for UnixAcceptor {
fn accept(&mut self) -> IoResult<~rtio::RtioPipe:Send> {
self.native_accept().map(|s| box s as ~rtio::RtioPipe:Send)
fn accept(&mut self) -> IoResult<Box<rtio::RtioPipe:Send>> {
self.native_accept().map(|s| box s as Box<rtio::RtioPipe:Send>)
}
fn set_timeout(&mut self, timeout: Option<u64>) {
self.deadline = timeout.map(|a| ::io::timer::now() + a).unwrap_or(0);