From 61e741cf714020107c6cda12793351fa5b8c7782 Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Thu, 25 Jul 2013 02:33:43 -0400 Subject: libstd: Implement {peer, socket}_name for new rt tcp & udp. --- src/libstd/rt/uv/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libstd/rt/uv/mod.rs') diff --git a/src/libstd/rt/uv/mod.rs b/src/libstd/rt/uv/mod.rs index 0eaf0dd3ab6..aacd747087e 100644 --- a/src/libstd/rt/uv/mod.rs +++ b/src/libstd/rt/uv/mod.rs @@ -282,14 +282,14 @@ pub fn uv_error_to_io_error(uverr: UvError) -> IoError { } /// Given a uv handle, convert a callback status to a UvError -// XXX: Follow the pattern below by parameterizing over T: Watcher, not T -pub fn status_to_maybe_uv_error(handle: *T, status: c_int) -> Option { +pub fn status_to_maybe_uv_error>(handle: U, + status: c_int) -> Option { if status != -1 { None } else { unsafe { rtdebug!("handle: %x", handle as uint); - let loop_ = uvll::get_loop_for_uv_handle(handle); + let loop_ = uvll::get_loop_for_uv_handle(handle.native_handle()); rtdebug!("loop: %x", loop_ as uint); let err = uvll::last_error(loop_); Some(UvError(err)) -- cgit 1.4.1-3-g733a5 From ac40d5323da30211c8dd516681c6e518777135e9 Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Thu, 25 Jul 2013 05:46:48 -0400 Subject: libstd: Fix errors when rtdebug! is not a noop. --- src/libstd/rt/test.rs | 4 ++-- src/libstd/rt/uv/mod.rs | 2 +- src/libstd/unstable/lang.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/libstd/rt/uv/mod.rs') diff --git a/src/libstd/rt/test.rs b/src/libstd/rt/test.rs index a9cbc6dae31..feae8b5ffd8 100644 --- a/src/libstd/rt/test.rs +++ b/src/libstd/rt/test.rs @@ -50,7 +50,7 @@ pub fn run_in_newsched_task(f: ~fn()) { let on_exit: ~fn(bool) = |exit_status| rtassert!(exit_status); let mut task = ~Task::new_root(&mut sched.stack_pool, f.take()); - rtdebug!("newsched_task: %x", to_uint(task)); + rtdebug!("newsched_task: %x", ::borrow::to_uint(task)); task.death.on_exit = Some(on_exit); sched.enqueue_task(task); sched.run(); @@ -145,7 +145,7 @@ pub fn spawntask(f: ~fn()) { } }; - rtdebug!("new task pointer: %x", to_uint(task)); + rtdebug!("new task pointer: %x", ::borrow::to_uint(task)); let sched = Local::take::(); rtdebug!("spawntask scheduling the new task"); diff --git a/src/libstd/rt/uv/mod.rs b/src/libstd/rt/uv/mod.rs index aacd747087e..638d510614a 100644 --- a/src/libstd/rt/uv/mod.rs +++ b/src/libstd/rt/uv/mod.rs @@ -288,7 +288,7 @@ pub fn status_to_maybe_uv_error>(handle: U, None } else { unsafe { - rtdebug!("handle: %x", handle as uint); + rtdebug!("handle: %x", handle.native_handle() as uint); let loop_ = uvll::get_loop_for_uv_handle(handle.native_handle()); rtdebug!("loop: %x", loop_ as uint); let err = uvll::last_error(loop_); diff --git a/src/libstd/unstable/lang.rs b/src/libstd/unstable/lang.rs index d96681ae803..7a5e1116c32 100644 --- a/src/libstd/unstable/lang.rs +++ b/src/libstd/unstable/lang.rs @@ -71,8 +71,8 @@ pub unsafe fn local_malloc(td: *c_char, size: uintptr_t) -> *c_char { let mut alloc = ::ptr::null(); do Local::borrow:: |task| { rtdebug!("task pointer: %x, heap pointer: %x", - to_uint(task), - to_uint(&task.heap)); + ::borrow::to_uint(task), + ::borrow::to_uint(&task.heap)); alloc = task.heap.alloc(td as *c_void, size as uint) as *c_char; } return alloc; -- cgit 1.4.1-3-g733a5