libstd: Work around some metadata infelicities that are causing problems in resolve3, and remove an unused glob

Conflicts:

	src/libstd/net_tcp.rs
	src/libstd/par.rs
This commit is contained in:
Patrick Walton 2012-06-26 14:18:24 -07:00
parent ccd2394ff9
commit d4672a078e
2 changed files with 9 additions and 7 deletions

View File

@ -6,6 +6,7 @@ import ip = net_ip;
import uv::iotask;
import uv::iotask::iotask;
import comm::methods;
import future_spawn = future::spawn;
import future::future;
import result::{result,err,ok,extensions};
@ -248,9 +249,9 @@ A `future` value that, once the `write` operation completes, resolves to a
value as the `err` variant
"]
fn write_future(sock: tcp_socket, raw_write_data: [u8]/~)
-> future::future<result::result<(), tcp_err_data>> unsafe {
-> future<result::result<(), tcp_err_data>> unsafe {
let socket_data_ptr = ptr::addr_of(*(sock.socket_data));
future::spawn {||
future_spawn {||
write_common_impl(socket_data_ptr, raw_write_data)
}
}
@ -337,9 +338,9 @@ Otherwise, use the blocking `tcp::read` function instead.
read attempt. Pass `0u` to wait indefinitely
"]
fn read_future(sock: tcp_socket, timeout_msecs: uint)
-> future::future<result::result<[u8]/~,tcp_err_data>> {
-> future<result::result<[u8]/~,tcp_err_data>> {
let socket_data = ptr::addr_of(*(sock.socket_data));
future::spawn {||
future_spawn {||
read_common_impl(socket_data, timeout_msecs)
}
}
@ -802,7 +803,7 @@ impl sock_methods for tcp_socket {
read(self, timeout_msecs)
}
fn read_future(timeout_msecs: uint) ->
future::future<result::result<[u8]/~, tcp_err_data>> {
future<result::result<[u8]/~, tcp_err_data>> {
read_future(self, timeout_msecs)
}
fn write(raw_write_data: [u8]/~)
@ -810,7 +811,7 @@ impl sock_methods for tcp_socket {
write(self, raw_write_data)
}
fn write_future(raw_write_data: [u8]/~)
-> future::future<result::result<(), tcp_err_data>> {
-> future<result::result<(), tcp_err_data>> {
write_future(self, raw_write_data)
}
}

View File

@ -2,6 +2,7 @@ import comm::port;
import comm::chan;
import comm::send;
import comm::recv;
import future_spawn = future::spawn;
import future::future;
export map, mapi, alli, any, mapi_factory;
@ -42,7 +43,7 @@ fn map_slices<A: copy send, B: copy send>(
// FIXME: why is the ::<A, ()> annotation required here? (#2617)
vec::unpack_slice::<A, ()>(xs) {|p, _len|
let f = f();
let f = future::spawn() {|copy base|
let f = future_spawn() {|copy base|
unsafe {
let len = end - base;
let slice = (ptr::offset(p, base),