From 9267b4f6120ff137f2ba8649e07ff093c9428340 Mon Sep 17 00:00:00 2001 From: yuqio Date: Tue, 23 Jun 2020 05:01:20 +0200 Subject: [PATCH] Remove unused crate imports in 2018 edition crates --- src/liballoc/collections/vec_deque/tests.rs | 2 -- src/librustc_ast_pretty/pprust/tests.rs | 1 - src/librustc_data_structures/sync.rs | 1 - src/libstd/os/illumos/fs.rs | 2 -- src/libstd/sys/unix/ext/net.rs | 3 --- src/libstd/sys/vxworks/args.rs | 1 - src/libstd/sys/vxworks/ext/fs.rs | 1 - src/libstd/sys/vxworks/rand.rs | 1 - src/libstd/sys/vxworks/rwlock.rs | 1 - src/libstd/sys/vxworks/time.rs | 2 -- src/libstd/sys/wasi/alloc.rs | 1 - src/tools/build-manifest/src/main.rs | 1 - src/tools/compiletest/src/json.rs | 1 - src/tools/compiletest/src/main.rs | 2 -- src/tools/compiletest/src/read2.rs | 1 - src/tools/compiletest/src/runtest.rs | 1 - 16 files changed, 22 deletions(-) diff --git a/src/liballoc/collections/vec_deque/tests.rs b/src/liballoc/collections/vec_deque/tests.rs index fc2ec7908e823..960af4bfda053 100644 --- a/src/liballoc/collections/vec_deque/tests.rs +++ b/src/liballoc/collections/vec_deque/tests.rs @@ -1,7 +1,5 @@ use super::*; -use test; - #[bench] #[cfg_attr(miri, ignore)] // isolated Miri does not support benchmarks fn bench_push_back_100(b: &mut test::Bencher) { diff --git a/src/librustc_ast_pretty/pprust/tests.rs b/src/librustc_ast_pretty/pprust/tests.rs index f51439f89ffbe..f92e40ed6ffab 100644 --- a/src/librustc_ast_pretty/pprust/tests.rs +++ b/src/librustc_ast_pretty/pprust/tests.rs @@ -2,7 +2,6 @@ use super::*; use rustc_ast::ast; use rustc_ast::with_default_globals; -use rustc_span; use rustc_span::source_map::respan; use rustc_span::symbol::Ident; diff --git a/src/librustc_data_structures/sync.rs b/src/librustc_data_structures/sync.rs index 39afb3d82ff5a..53d831749ceb7 100644 --- a/src/librustc_data_structures/sync.rs +++ b/src/librustc_data_structures/sync.rs @@ -358,7 +358,6 @@ cfg_if! { use parking_lot::Mutex as InnerLock; use parking_lot::RwLock as InnerRwLock; - use std; use std::thread; pub use rayon::{join, scope}; diff --git a/src/libstd/os/illumos/fs.rs b/src/libstd/os/illumos/fs.rs index 2abbf1fa9fa16..b668aa2595d67 100644 --- a/src/libstd/os/illumos/fs.rs +++ b/src/libstd/os/illumos/fs.rs @@ -1,7 +1,5 @@ #![stable(feature = "metadata_ext", since = "1.1.0")] -use libc; - use crate::fs::Metadata; use crate::sys_common::AsInner; diff --git a/src/libstd/sys/unix/ext/net.rs b/src/libstd/sys/unix/ext/net.rs index cd24605ec7ab7..ada8eaa1c9745 100644 --- a/src/libstd/sys/unix/ext/net.rs +++ b/src/libstd/sys/unix/ext/net.rs @@ -2,9 +2,6 @@ //! Unix-specific networking functionality -#[cfg(unix)] -use libc; - // FIXME(#43348): Make libc adapt #[doc(cfg(...))] so we don't need these fake definitions here? #[cfg(not(unix))] #[allow(non_camel_case_types)] diff --git a/src/libstd/sys/vxworks/args.rs b/src/libstd/sys/vxworks/args.rs index efd615f404db6..adff6c489bbc9 100644 --- a/src/libstd/sys/vxworks/args.rs +++ b/src/libstd/sys/vxworks/args.rs @@ -56,7 +56,6 @@ mod imp { use crate::ffi::{CStr, OsString}; use crate::marker::PhantomData; use crate::ptr; - use libc; use crate::sys_common::mutex::Mutex; diff --git a/src/libstd/sys/vxworks/ext/fs.rs b/src/libstd/sys/vxworks/ext/fs.rs index 9864a855df738..7cc64658ee1a9 100644 --- a/src/libstd/sys/vxworks/ext/fs.rs +++ b/src/libstd/sys/vxworks/ext/fs.rs @@ -6,7 +6,6 @@ use crate::path::Path; use crate::sys; use crate::sys::platform::fs::MetadataExt as UnixMetadataExt; use crate::sys_common::{AsInner, AsInnerMut, FromInner}; -use libc; /// Unix-specific extensions to [`File`]. /// diff --git a/src/libstd/sys/vxworks/rand.rs b/src/libstd/sys/vxworks/rand.rs index 87ebd2c9593fc..3a1ff5fd3b9c6 100644 --- a/src/libstd/sys/vxworks/rand.rs +++ b/src/libstd/sys/vxworks/rand.rs @@ -13,7 +13,6 @@ pub fn hashmap_random_keys() -> (u64, u64) { mod imp { use crate::io; use core::sync::atomic::{AtomicBool, Ordering::Relaxed}; - use libc; pub fn fill_bytes(v: &mut [u8]) { static RNG_INIT: AtomicBool = AtomicBool::new(false); diff --git a/src/libstd/sys/vxworks/rwlock.rs b/src/libstd/sys/vxworks/rwlock.rs index fd2e1a6e7bcfb..c90304c2b4a6a 100644 --- a/src/libstd/sys/vxworks/rwlock.rs +++ b/src/libstd/sys/vxworks/rwlock.rs @@ -1,6 +1,5 @@ use crate::cell::UnsafeCell; use crate::sync::atomic::{AtomicUsize, Ordering}; -use libc; pub struct RWLock { inner: UnsafeCell, diff --git a/src/libstd/sys/vxworks/time.rs b/src/libstd/sys/vxworks/time.rs index 8ebbf89213f32..8365c9ee9c995 100644 --- a/src/libstd/sys/vxworks/time.rs +++ b/src/libstd/sys/vxworks/time.rs @@ -1,7 +1,6 @@ use crate::cmp::Ordering; use crate::time::Duration; use ::core::hash::{Hash, Hasher}; -use libc; pub use self::inner::{Instant, SystemTime, UNIX_EPOCH}; use crate::convert::TryInto; @@ -104,7 +103,6 @@ mod inner { use crate::fmt; use crate::sys::cvt; use crate::time::Duration; - use libc; use super::Timespec; diff --git a/src/libstd/sys/wasi/alloc.rs b/src/libstd/sys/wasi/alloc.rs index bc61416278401..57187851a14e3 100644 --- a/src/libstd/sys/wasi/alloc.rs +++ b/src/libstd/sys/wasi/alloc.rs @@ -1,7 +1,6 @@ use crate::alloc::{GlobalAlloc, Layout, System}; use crate::ptr; use crate::sys_common::alloc::{realloc_fallback, MIN_ALIGN}; -use libc; #[stable(feature = "alloc_system_type", since = "1.28.0")] unsafe impl GlobalAlloc for System { diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs index 39baa6b8540df..9eb43eb2df43f 100644 --- a/src/tools/build-manifest/src/main.rs +++ b/src/tools/build-manifest/src/main.rs @@ -7,7 +7,6 @@ #![deny(warnings)] use serde::Serialize; -use toml; use std::collections::BTreeMap; use std::collections::HashMap; diff --git a/src/tools/compiletest/src/json.rs b/src/tools/compiletest/src/json.rs index 52d0cbd4bfd7a..6ac7c3b9b474a 100644 --- a/src/tools/compiletest/src/json.rs +++ b/src/tools/compiletest/src/json.rs @@ -4,7 +4,6 @@ use crate::errors::{Error, ErrorKind}; use crate::runtest::ProcRes; use serde::Deserialize; -use serde_json; use std::path::{Path, PathBuf}; use std::str::FromStr; diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs index c00b0f02c3a90..134ac66b7d15b 100644 --- a/src/tools/compiletest/src/main.rs +++ b/src/tools/compiletest/src/main.rs @@ -9,8 +9,6 @@ extern crate test; use crate::common::{expected_output_path, output_base_dir, output_relative_path, UI_EXTENSIONS}; use crate::common::{CompareMode, Config, Debugger, Mode, PassMode, Pretty, TestPaths}; use crate::util::logv; -use env_logger; -use getopts; use getopts::Options; use log::*; use std::env; diff --git a/src/tools/compiletest/src/read2.rs b/src/tools/compiletest/src/read2.rs index da1d3db49d70e..30a922057eb20 100644 --- a/src/tools/compiletest/src/read2.rs +++ b/src/tools/compiletest/src/read2.rs @@ -25,7 +25,6 @@ mod imp { #[cfg(unix)] mod imp { - use libc; use std::io; use std::io::prelude::*; use std::mem; diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 95ea4fb078955..dd0c68ecd4965 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -13,7 +13,6 @@ use crate::header::TestProps; use crate::json; use crate::util::get_pointer_width; use crate::util::{logv, PathBufExt}; -use diff; use regex::{Captures, Regex}; use rustfix::{apply_suggestions, get_suggestions_from_json, Filter};