about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2013-05-30 13:20:17 -0700
committerBrian Anderson <banderson@mozilla.com>2013-05-30 13:20:17 -0700
commitea633b42aeadf807a10036a87bf2903123250152 (patch)
treee99e3a65b8caeabc673aa30e514c37a81168fdb5 /src
parent053b38e7e1cba8f7bb649a5fc8d82b0448d33c55 (diff)
downloadrust-ea633b42aeadf807a10036a87bf2903123250152.tar.gz
rust-ea633b42aeadf807a10036a87bf2903123250152.zip
core::rt: deny(unused_imports, unused_mut, unused_variable)
Diffstat (limited to 'src')
-rw-r--r--src/libstd/rt/comm.rs1
-rw-r--r--src/libstd/rt/local.rs1
-rw-r--r--src/libstd/rt/mod.rs5
-rw-r--r--src/libstd/rt/sched.rs11
-rw-r--r--src/libstd/rt/sleeper_list.rs2
-rw-r--r--src/libstd/rt/test.rs8
-rw-r--r--src/libstd/rt/uv/uvio.rs5
7 files changed, 11 insertions, 22 deletions
diff --git a/src/libstd/rt/comm.rs b/src/libstd/rt/comm.rs
index 19fb809d437..26d02fb6640 100644
--- a/src/libstd/rt/comm.rs
+++ b/src/libstd/rt/comm.rs
@@ -22,7 +22,6 @@ use ops::Drop;
 use kinds::Owned;
 use rt::sched::{Scheduler, Coroutine};
 use rt::local::Local;
-use rt::rtio::EventLoop;
 use unstable::intrinsics::{atomic_xchg, atomic_load};
 use util::Void;
 use comm::{GenericChan, GenericSmartChan, GenericPort, Peekable};
diff --git a/src/libstd/rt/local.rs b/src/libstd/rt/local.rs
index ffff54f00bb..e6988c53888 100644
--- a/src/libstd/rt/local.rs
+++ b/src/libstd/rt/local.rs
@@ -87,7 +87,6 @@ impl Local for IoFactoryObject {
 mod test {
     use rt::test::*;
     use rt::sched::Scheduler;
-    use rt::uv::uvio::UvEventLoop;
     use super::*;
 
     #[test]
diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs
index 23dc7578002..caf3e15e535 100644
--- a/src/libstd/rt/mod.rs
+++ b/src/libstd/rt/mod.rs
@@ -55,6 +55,9 @@ Several modules in `core` are clients of `rt`:
 */
 
 #[doc(hidden)];
+#[deny(unused_imports)];
+#[deny(unused_mut)];
+#[deny(unused_variable)];
 
 use ptr::Ptr;
 
@@ -228,8 +231,6 @@ pub fn context() -> RuntimeContext {
 fn test_context() {
     use unstable::run_in_bare_thread;
     use self::sched::{Scheduler, Coroutine};
-    use rt::uv::uvio::UvEventLoop;
-    use cell::Cell;
     use rt::local::Local;
     use rt::test::new_test_uv_sched;
 
diff --git a/src/libstd/rt/sched.rs b/src/libstd/rt/sched.rs
index a57a87ffba7..b0080a01014 100644
--- a/src/libstd/rt/sched.rs
+++ b/src/libstd/rt/sched.rs
@@ -13,7 +13,6 @@ use sys;
 use cast::transmute;
 use cell::Cell;
 use clone::Clone;
-use to_str::ToStr;
 
 use super::sleeper_list::SleeperList;
 use super::work_queue::WorkQueue;
@@ -24,7 +23,7 @@ use super::task::Task;
 use super::message_queue::MessageQueue;
 use rt::local_ptr;
 use rt::local::Local;
-use rt::rtio::{IoFactoryObject, RemoteCallback};
+use rt::rtio::RemoteCallback;
 use rt::metrics::SchedMetrics;
 
 /// The Scheduler is responsible for coordinating execution of Coroutines
@@ -583,7 +582,6 @@ impl ClosureConverter for UnsafeTaskReceiver {
 mod test {
     use int;
     use cell::Cell;
-    use rt::uv::uvio::UvEventLoop;
     use unstable::run_in_bare_thread;
     use task::spawn;
     use rt::local::Local;
@@ -751,13 +749,13 @@ mod test {
 
             let sched1_cell = Cell(sched1);
             let _thread1 = do Thread::start {
-                let mut sched1 = sched1_cell.take();
+                let sched1 = sched1_cell.take();
                 sched1.run();
             };
 
             let sched2_cell = Cell(sched2);
             let _thread2 = do Thread::start {
-                let mut sched2 = sched2_cell.take();
+                let sched2 = sched2_cell.take();
                 sched2.run();
             };
         }
@@ -790,9 +788,6 @@ mod test {
     #[test]
     fn thread_ring() {
         use rt::comm::*;
-        use iter::Times;
-        use vec::OwnedVector;
-        use container::Container;
         use comm::{GenericPort, GenericChan};
 
         do run_in_mt_newsched_task {
diff --git a/src/libstd/rt/sleeper_list.rs b/src/libstd/rt/sleeper_list.rs
index dfcac8eb088..e2873e78d80 100644
--- a/src/libstd/rt/sleeper_list.rs
+++ b/src/libstd/rt/sleeper_list.rs
@@ -16,7 +16,7 @@ use vec::OwnedVector;
 use option::{Option, Some, None};
 use cell::Cell;
 use unstable::sync::{Exclusive, exclusive};
-use rt::sched::{Scheduler, SchedHandle};
+use rt::sched::SchedHandle;
 use clone::Clone;
 
 pub struct SleeperList {
diff --git a/src/libstd/rt/test.rs b/src/libstd/rt/test.rs
index e05e2004e0b..907d289fb07 100644
--- a/src/libstd/rt/test.rs
+++ b/src/libstd/rt/test.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 use uint;
-use option::{Option, Some, None};
+use option::{Some, None};
 use cell::Cell;
 use clone::Clone;
 use container::Container;
@@ -42,7 +42,6 @@ pub fn new_test_uv_sched() -> Scheduler {
 pub fn run_in_newsched_task(f: ~fn()) {
     use super::sched::*;
     use unstable::run_in_bare_thread;
-    use rt::uv::uvio::UvEventLoop;
 
     let f = Cell(f);
 
@@ -74,7 +73,7 @@ pub fn run_in_mt_newsched_task(f: ~fn()) {
         let mut handles = ~[];
         let mut scheds = ~[];
 
-        for uint::range(0, N) |i| {
+        for uint::range(0, N) |_| {
             let loop_ = ~UvEventLoop::new();
             let mut sched = ~Scheduler::new(loop_, work_queue.clone(), sleepers.clone());
             let handle = sched.make_handle();
@@ -102,7 +101,7 @@ pub fn run_in_mt_newsched_task(f: ~fn()) {
             let sched = scheds.pop();
             let sched_cell = Cell(sched);
             let thread = do Thread::start {
-                let mut sched = sched_cell.take();
+                let sched = sched_cell.take();
                 sched.run();
             };
 
@@ -214,7 +213,6 @@ pub fn spawntask_try(f: ~fn()) -> Result<(), ()> {
 // Spawn a new task in a new scheduler and return a thread handle.
 pub fn spawntask_thread(f: ~fn()) -> Thread {
     use rt::sched::*;
-    use rt::uv::uvio::UvEventLoop;
 
     let f = Cell(f);
     let thread = do Thread::start {
diff --git a/src/libstd/rt/uv/uvio.rs b/src/libstd/rt/uv/uvio.rs
index 1ee6504d11f..0d9530239a3 100644
--- a/src/libstd/rt/uv/uvio.rs
+++ b/src/libstd/rt/uv/uvio.rs
@@ -24,9 +24,7 @@ use rt::sched::Scheduler;
 use rt::io::{standard_error, OtherIoError};
 use rt::tube::Tube;
 use rt::local::Local;
-use rt::work_queue::WorkQueue;
 use unstable::sync::{UnsafeAtomicRcBox, AtomicInt};
-use unstable::intrinsics;
 
 #[cfg(test)] use container::Container;
 #[cfg(test)] use uint;
@@ -140,7 +138,7 @@ impl RemoteCallback for UvRemoteCallback {
 impl Drop for UvRemoteCallback {
     fn finalize(&self) {
         unsafe {
-            let mut this: &mut UvRemoteCallback = cast::transmute_mut(self);
+            let this: &mut UvRemoteCallback = cast::transmute_mut(self);
             let exit_flag_ptr = this.exit_flag.get();
             (*exit_flag_ptr).store(1);
             this.async.send();
@@ -150,7 +148,6 @@ impl Drop for UvRemoteCallback {
 
 #[cfg(test)]
 mod test_remote {
-    use super::*;
     use cell;
     use cell::Cell;
     use rt::test::*;