core::rt: deny(unused_imports, unused_mut, unused_variable)
This commit is contained in:
parent
053b38e7e1
commit
ea633b42ae
7 changed files with 11 additions and 22 deletions
|
|
@ -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};
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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::*;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue