about summary refs log tree commit diff
path: root/src/libcore/rt
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-04-20 01:00:49 -0700
committerbors <bors@rust-lang.org>2013-04-20 01:00:49 -0700
commit4ff701b7db609cabe59832d47779832a16627b5f (patch)
tree49317e2439d493b798412dad2c92b60e366f229f /src/libcore/rt
parent028dc589d1cfb7e44b36b978ea1dcc304d70cee0 (diff)
parentcd982ad3f74673c55af6034a4f757e60be9b381c (diff)
downloadrust-4ff701b7db609cabe59832d47779832a16627b5f.tar.gz
rust-4ff701b7db609cabe59832d47779832a16627b5f.zip
auto merge of #5965 : alexcrichton/rust/issue-4364, r=pcwalton
This closes #4364. I came into rust after modes had begun to be phased out, so I'm not exactly sure what they all did. My strategy was basically to turn on the compilation warnings and then when everything compiles and passes all the tests it's all good.

In most cases, I just dropped the mode, but in others I converted things to use `&` pointers when otherwise a move would happen.

This depends on #5963. When running the tests, everything passed except for a few compile-fail tests. These tests leaked memory, causing the task to abort differently. By suppressing the ICE from #5963, no leaks happen and the tests all pass. I would have looked into where the leaks were coming from, but I wasn't sure where or how to debug them (I found `RUSTRT_TRACK_ALLOCATIONS`, but it wasn't all that useful).
Diffstat (limited to 'src/libcore/rt')
-rw-r--r--src/libcore/rt/sched/local_sched.rs22
-rw-r--r--src/libcore/rt/uv/net.rs2
2 files changed, 11 insertions, 13 deletions
diff --git a/src/libcore/rt/sched/local_sched.rs b/src/libcore/rt/sched/local_sched.rs
index 2ab50252ac6..77fbadf0bb7 100644
--- a/src/libcore/rt/sched/local_sched.rs
+++ b/src/libcore/rt/sched/local_sched.rs
@@ -66,18 +66,16 @@ pub fn borrow(f: &fn(&mut Scheduler)) {
 /// Because this leaves the Scheduler in thread-local storage it is possible
 /// For the Scheduler pointer to be aliased
 pub unsafe fn unsafe_borrow() -> &mut Scheduler {
-    unsafe {
-        let key = tls_key();
-        let mut void_sched: *mut c_void = tls::get(key);
-        assert!(void_sched.is_not_null());
-        {
-            let void_sched_ptr = &mut void_sched;
-            let sched: &mut ~Scheduler = {
-                transmute::<&mut *mut c_void, &mut ~Scheduler>(void_sched_ptr)
-            };
-            let sched: &mut Scheduler = &mut **sched;
-            return sched;
-        }
+    let key = tls_key();
+    let mut void_sched: *mut c_void = tls::get(key);
+    assert!(void_sched.is_not_null());
+    {
+        let void_sched_ptr = &mut void_sched;
+        let sched: &mut ~Scheduler = {
+            transmute::<&mut *mut c_void, &mut ~Scheduler>(void_sched_ptr)
+        };
+        let sched: &mut Scheduler = &mut **sched;
+        return sched;
     }
 }
 
diff --git a/src/libcore/rt/uv/net.rs b/src/libcore/rt/uv/net.rs
index 0dc1a4d86cb..b4a08c14928 100644
--- a/src/libcore/rt/uv/net.rs
+++ b/src/libcore/rt/uv/net.rs
@@ -388,7 +388,7 @@ fn connect_read() {
                 vec_to_uv_buf(vec::from_elem(size, 0))
             };
             do stream_watcher.read_start(alloc)
-                |stream_watcher, nread, buf, status| {
+                |stream_watcher, _nread, buf, status| {
 
                 let buf = vec_from_uv_buf(buf);
                 rtdebug!("read cb!");