diff options
| author | bors <bors@rust-lang.org> | 2015-12-30 07:35:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-12-30 07:35:10 +0000 |
| commit | a06bb977d86dcfe786d4265f4807a11c39b51141 (patch) | |
| tree | 27a2b4e75bd918cbe2276a3e9a26eac34825e72f /src/libstd/thread | |
| parent | 6e2a64b57a74f35bef215972adf1b803cff288bd (diff) | |
| parent | e27cbeff370897b8450caa204c08049651a10c13 (diff) | |
| download | rust-a06bb977d86dcfe786d4265f4807a11c39b51141.tar.gz rust-a06bb977d86dcfe786d4265f4807a11c39b51141.zip | |
Auto merge of #30458 - fhahn:fix-warnings-tests-stdlib, r=sanxiyn
This PR siliences some warnings when compiling stdlib with --test. Mostly remove some unused imports and added a few `#[allow(..)]`. I also marked some signal handling functions with `#[cfg(not(test))]`, because they are only called through `rt::lang_start`, which is also marked as `#[cfg(not(test))]`
Diffstat (limited to 'src/libstd/thread')
| -rw-r--r-- | src/libstd/thread/mod.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 0e525f39421..116cd5da2ce 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -830,14 +830,14 @@ mod tests { fn test_park_timeout_unpark_before() { for _ in 0..10 { thread::current().unpark(); - thread::park_timeout_ms(u32::MAX); + thread::park_timeout(Duration::from_millis(u32::MAX as u64)); } } #[test] fn test_park_timeout_unpark_not_called() { for _ in 0..10 { - thread::park_timeout_ms(10); + thread::park_timeout(Duration::from_millis(10)); } } @@ -847,17 +847,17 @@ mod tests { let th = thread::current(); let _guard = thread::spawn(move || { - super::sleep_ms(50); + super::sleep(Duration::from_millis(50)); th.unpark(); }); - thread::park_timeout_ms(u32::MAX); + thread::park_timeout(Duration::from_millis(u32::MAX as u64)); } } #[test] fn sleep_ms_smoke() { - thread::sleep_ms(2); + thread::sleep(Duration::from_millis(2)); } // NOTE: the corresponding test for stderr is in run-pass/thread-stderr, due |
