diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-06-23 14:15:39 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-06-24 17:07:03 -0700 |
| commit | d071f51cdc7c3492ae2bc4180ffbf13bcdb31439 (patch) | |
| tree | 66c0dbf70798728bf0adeaed716e716bec06b450 /src/libstd | |
| parent | b530ca103388c99e774868645758785d6ad6b9a9 (diff) | |
| download | rust-d071f51cdc7c3492ae2bc4180ffbf13bcdb31439.tar.gz rust-d071f51cdc7c3492ae2bc4180ffbf13bcdb31439.zip | |
std::rt: deny(unused_unsafe)
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/rt/mod.rs | 3 | ||||
| -rw-r--r-- | src/libstd/rt/test.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rt/uv/timer.rs | 4 |
3 files changed, 5 insertions, 4 deletions
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(||()); } } |
