diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs index fec555e8afd..8713cf05a47 100644 --- a/src/libstd/rt/mod.rs +++ b/src/libstd/rt/mod.rs @@ -58,6 +58,7 @@ Several modules in `core` are clients of `rt`: #[deny(unused_imports)]; #[deny(unused_mut)]; #[deny(unused_variable)]; +#[deny(unused_unsafe)]; use cell::Cell; use clone::Clone; @@ -224,7 +225,7 @@ pub fn run(main: ~fn()) -> int { let nthreads = match os::getenv("RUST_THREADS") { Some(nstr) => FromStr::from_str(nstr).get(), - None => unsafe { util::num_cpus() } + None => util::num_cpus() }; // The shared list of sleeping schedulers. Schedulers wake each other diff --git a/src/libstd/rt/test.rs b/src/libstd/rt/test.rs index 36efcd91834..b0e49684014 100644 --- a/src/libstd/rt/test.rs +++ b/src/libstd/rt/test.rs @@ -74,7 +74,7 @@ pub fn run_in_mt_newsched_task(f: ~fn()) { do run_in_bare_thread { let nthreads = match os::getenv("RUST_TEST_THREADS") { Some(nstr) => FromStr::from_str(nstr).get(), - None => unsafe { + None => { // Using more threads than cores in test code // to force the OS to preempt them frequently. // Assuming that this help stress test concurrent types. diff --git a/src/libstd/rt/uv/timer.rs b/src/libstd/rt/uv/timer.rs index cd6fc5c0a25..14465eb7dfd 100644 --- a/src/libstd/rt/uv/timer.rs +++ b/src/libstd/rt/uv/timer.rs @@ -160,14 +160,14 @@ mod test { let mut timer2 = TimerWatcher::new(&mut loop_); do timer2.start(10, 0) |timer2, _| { - unsafe { *count_ptr += 1; } + *count_ptr += 1; timer2.close(||()); // Restart the original timer let mut timer = timer; do timer.start(1, 0) |timer, _| { - unsafe { *count_ptr += 1; } + *count_ptr += 1; timer.close(||()); } }