diff --git a/src/libcore/task.rs b/src/libcore/task.rs
index 863efc79d4a..fb08a971385 100644
--- a/src/libcore/task.rs
+++ b/src/libcore/task.rs
@@ -2089,7 +2089,7 @@ fn test_child_doesnt_ref_parent() {
fn test_tls_multitask() unsafe {
fn my_key(+_x: @~str) { }
local_data_set(my_key, @~"parent data");
- do task::spawn {
+ do task::spawn unsafe {
assert local_data_get(my_key) == none; // TLS shouldn't carry over.
local_data_set(my_key, @~"child data");
assert *(local_data_get(my_key).get()) == ~"child data";
@@ -2155,7 +2155,7 @@ fn test_tls_multiple_types() unsafe {
fn str_key(+_x: @~str) { }
fn box_key(+_x: @@()) { }
fn int_key(+_x: @int) { }
- do task::spawn {
+ do task::spawn unsafe {
local_data_set(str_key, @~"string data");
local_data_set(box_key, @@());
local_data_set(int_key, @42);
@@ -2163,11 +2163,11 @@ fn test_tls_multiple_types() unsafe {
}
#[test]
-fn test_tls_overwrite_multiple_types() unsafe {
+fn test_tls_overwrite_multiple_types() {
fn str_key(+_x: @~str) { }
fn box_key(+_x: @@()) { }
fn int_key(+_x: @int) { }
- do task::spawn {
+ do task::spawn unsafe {
local_data_set(str_key, @~"string data");
local_data_set(int_key, @42);
// This could cause a segfault if overwriting-destruction is done with
@@ -2185,7 +2185,7 @@ fn test_tls_cleanup_on_failure() unsafe {
fn int_key(+_x: @int) { }
local_data_set(str_key, @~"parent data");
local_data_set(box_key, @@());
- do task::spawn { // spawn_linked
+ do task::spawn unsafe { // spawn_linked
local_data_set(str_key, @~"string data");
local_data_set(box_key, @@());
local_data_set(int_key, @42);
diff --git a/src/libstd/net_ip.rs b/src/libstd/net_ip.rs
index f7a7f42afcf..57cc8bd0357 100644
--- a/src/libstd/net_ip.rs
+++ b/src/libstd/net_ip.rs
@@ -85,9 +85,9 @@ enum ip_get_addr_err {
* object in the case of failure
*/
fn get_addr(++node: ~str, iotask: iotask)
- -> result::result<~[ip_addr], ip_get_addr_err> unsafe {
+ -> result::result<~[ip_addr], ip_get_addr_err> {
do core::comm::listen |output_ch| {
- do str::as_buf(node) |node_ptr, len| {
+ do str::as_buf(node) |node_ptr, len| unsafe {
log(debug, fmt!("slice len %?", len));
let handle = create_uv_getaddrinfo_t();
let handle_ptr = ptr::addr_of(handle);
@@ -95,7 +95,7 @@ fn get_addr(++node: ~str, iotask: iotask)
output_ch: output_ch
};
let handle_data_ptr = ptr::addr_of(handle_data);
- do interact(iotask) |loop_ptr| {
+ do interact(iotask) |loop_ptr| unsafe {
let result = uv_getaddrinfo(
loop_ptr,
handle_ptr,
diff --git a/src/libstd/net_tcp.rs b/src/libstd/net_tcp.rs
index d1cbe221ed3..170823eb79d 100644
--- a/src/libstd/net_tcp.rs
+++ b/src/libstd/net_tcp.rs
@@ -145,7 +145,7 @@ fn connect(-input_ip: ip::ip_addr, port: uint,
// we can send into the interact cb to be handled in libuv..
log(debug, fmt!("stream_handle_ptr outside interact %?",
stream_handle_ptr));
- do iotask::interact(iotask) |loop_ptr| {
+ do iotask::interact(iotask) |loop_ptr| unsafe {
log(debug, ~"in interact cb for tcp client connect..");
log(debug, fmt!("stream_handle_ptr in interact %?",
stream_handle_ptr));
@@ -571,7 +571,7 @@ fn listen(-host_ip: ip::ip_addr, port: uint, backlog: uint,
-> result::result<(), tcp_listen_err_data> unsafe {
do listen_common(host_ip, port, backlog, iotask, on_establish_cb)
// on_connect_cb
- |handle| {
+ |handle| unsafe {
let server_data_ptr = uv::ll::get_data_for_uv_handle(handle)
as *tcp_listen_fc_data;
let new_conn = new_tcp_conn(handle);
@@ -608,7 +608,7 @@ fn listen_common(-host_ip: ip::ip_addr, port: uint, backlog: uint,
// tcp::connect (because the iotask::interact cb isn't
// nested within a core::comm::listen block)
let loc_ip = copy(host_ip);
- do iotask::interact(iotask) |loop_ptr| {
+ do iotask::interact(iotask) |loop_ptr| unsafe {
match uv::ll::tcp_init(loop_ptr, server_stream_ptr) {
0i32 => {
uv::ll::set_data_for_uv_handle(
@@ -660,7 +660,7 @@ fn listen_common(-host_ip: ip::ip_addr, port: uint, backlog: uint,
};
match setup_result {
some(err_data) => {
- do iotask::interact(iotask) |loop_ptr| {
+ do iotask::interact(iotask) |loop_ptr| unsafe {
log(debug, fmt!("tcp::listen post-kill recv hl interact %?",
loop_ptr));
(*server_data_ptr).active = false;
@@ -687,7 +687,7 @@ fn listen_common(-host_ip: ip::ip_addr, port: uint, backlog: uint,
none => {
on_establish_cb(kill_ch);
let kill_result = core::comm::recv(kill_po);
- do iotask::interact(iotask) |loop_ptr| {
+ do iotask::interact(iotask) |loop_ptr| unsafe {
log(debug, fmt!("tcp::listen post-kill recv hl interact %?",
loop_ptr));
(*server_data_ptr).active = false;
@@ -844,7 +844,7 @@ fn tear_down_socket_data(socket_data: @tcp_socket_data) unsafe {
};
let close_data_ptr = ptr::addr_of(close_data);
let stream_handle_ptr = (*socket_data).stream_handle_ptr;
- do iotask::interact((*socket_data).iotask) |loop_ptr| {
+ do iotask::interact((*socket_data).iotask) |loop_ptr| unsafe {
log(debug, fmt!("interact dtor for tcp_socket stream %? loop %?",
stream_handle_ptr, loop_ptr));
uv::ll::set_data_for_uv_handle(stream_handle_ptr,
@@ -902,7 +902,7 @@ fn read_stop_common_impl(socket_data: *tcp_socket_data) ->
let stream_handle_ptr = (*socket_data).stream_handle_ptr;
let stop_po = core::comm::port::