about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorIgor Aleksanov <popzxc@yandex.ru>2019-10-21 09:05:40 +0300
committerIgor Aleksanov <popzxc@yandex.ru>2019-10-21 09:05:40 +0300
commitae04dc8473f9ea53b71123eb4eb0fcec71e6d797 (patch)
tree29a2311e9fa1b3244c741be2a5f848ce211b89f2 /src
parenta06b205177e714fc68fec2a2b0efe5b57d4eb865 (diff)
downloadrust-ae04dc8473f9ea53b71123eb4eb0fcec71e6d797.tar.gz
rust-ae04dc8473f9ea53b71123eb4eb0fcec71e6d797.zip
Remove unneccessary use under cfg(unix)
Diffstat (limited to 'src')
-rw-r--r--src/libtest/helpers/concurrency.rs14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/libtest/helpers/concurrency.rs b/src/libtest/helpers/concurrency.rs
index f0292c2d2c7..61651a927c5 100644
--- a/src/libtest/helpers/concurrency.rs
+++ b/src/libtest/helpers/concurrency.rs
@@ -2,9 +2,6 @@
 //! during tests execution.
 use std::env;
 
-#[cfg(any(unix, target_os = "cloudabi"))]
-use libc;
-
 #[allow(deprecated)]
 pub fn get_concurrency() -> usize {
     return match env::var("RUST_TEST_THREADS") {
@@ -12,10 +9,7 @@ pub fn get_concurrency() -> usize {
             let opt_n: Option<usize> = s.parse().ok();
             match opt_n {
                 Some(n) if n > 0 => n,
-                _ => panic!(
-                    "RUST_TEST_THREADS is `{}`, should be a positive integer.",
-                    s
-                ),
+                _ => panic!("RUST_TEST_THREADS is `{}`, should be a positive integer.", s),
             }
         }
         Err(..) => num_cpus(),
@@ -82,11 +76,7 @@ pub fn get_concurrency() -> usize {
         unsafe { libc::sysconf(libc::_SC_NPROCESSORS_ONLN) as usize }
     }
 
-    #[cfg(any(
-        target_os = "freebsd",
-        target_os = "dragonfly",
-        target_os = "netbsd"
-    ))]
+    #[cfg(any(target_os = "freebsd", target_os = "dragonfly", target_os = "netbsd"))]
     fn num_cpus() -> usize {
         use std::ptr;