rustc: Implement unary move. Closes #917.

This commit is contained in:
Patrick Walton
2012-07-31 17:31:24 -07:00
parent c4bb8f8aaf
commit c88933d714
15 changed files with 48 additions and 24 deletions

View File

@@ -60,7 +60,7 @@ fn from_value<A>(+val: A) -> future<A> {
})
}
macro_rules! move{
macro_rules! move_it {
{$x:expr} => { unsafe { let y <- *ptr::addr_of($x); y } }
}
@@ -78,7 +78,7 @@ fn from_port<A:send>(-port: future_pipe::client::waiting<A>) -> future<A> {
port_ <-> *port;
let port = option::unwrap(port_);
alt recv(port) {
future_pipe::completed(data) { move!{data} }
future_pipe::completed(data) { move_it!{data} }
}
}
}