From ba1b27f51607a64072c9ddf071cb69a143922cb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20S=C3=A1nchez=20Mu=C3=B1oz?= Date: Thu, 5 Sep 2024 17:56:43 +0200 Subject: [PATCH] Remove unneeded `extern crate`s and imports --- build.rs | 1 - libc-test/build.rs | 1 - libc-test/test/cmsg.rs | 2 -- libc-test/test/errqueue.rs | 2 -- libc-test/test/linux_elf.rs | 1 - libc-test/test/linux_fcntl.rs | 1 - libc-test/test/linux_if_arp.rs | 1 - libc-test/test/linux_ipv6.rs | 1 - libc-test/test/linux_kernel_version.rs | 2 -- libc-test/test/linux_strerror_r.rs | 1 - libc-test/test/linux_termios.rs | 1 - libc-test/test/main.rs | 1 - libc-test/test/makedev.rs | 2 -- libc-test/test/semver.rs | 2 -- libc-test/test/sigrt.rs | 2 -- 15 files changed, 21 deletions(-) diff --git a/build.rs b/build.rs index cde1b35294deb..287fe9740589a 100644 --- a/build.rs +++ b/build.rs @@ -1,5 +1,4 @@ use std::env; -use std::ffi::{OsStr, OsString}; use std::process::{Command, Output}; use std::str; diff --git a/libc-test/build.rs b/libc-test/build.rs index da12acade8f00..938294717eee3 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -1,6 +1,5 @@ #![deny(warnings)] -extern crate cc; extern crate ctest2 as ctest; use std::fs::File; diff --git a/libc-test/test/cmsg.rs b/libc-test/test/cmsg.rs index baef3902d603e..52bf9830212c2 100644 --- a/libc-test/test/cmsg.rs +++ b/libc-test/test/cmsg.rs @@ -1,8 +1,6 @@ //! Compare libc's CMSG(3) family of functions against the actual C macros, for //! various inputs. -extern crate libc; - #[cfg(unix)] mod t { diff --git a/libc-test/test/errqueue.rs b/libc-test/test/errqueue.rs index 8d0c7bb741676..a7d1563c5cf39 100644 --- a/libc-test/test/errqueue.rs +++ b/libc-test/test/errqueue.rs @@ -1,7 +1,5 @@ //! Compare libc's SO_EE_OFFENDER function against the actual C macro -extern crate libc; - #[cfg(any(target_os = "linux", target_os = "android"))] mod t { use libc::{self, sock_extended_err, sockaddr}; diff --git a/libc-test/test/linux_elf.rs b/libc-test/test/linux_elf.rs index d149c9aaff38e..e0ebe4ad4d1e5 100644 --- a/libc-test/test/linux_elf.rs +++ b/libc-test/test/linux_elf.rs @@ -1,6 +1,5 @@ #![allow(bad_style, improper_ctypes, unused, deprecated)] -extern crate libc; use libc::*; #[cfg(target_os = "linux")] diff --git a/libc-test/test/linux_fcntl.rs b/libc-test/test/linux_fcntl.rs index 49c06cc4f6517..d4647d2ef1a65 100644 --- a/libc-test/test/linux_fcntl.rs +++ b/libc-test/test/linux_fcntl.rs @@ -1,6 +1,5 @@ #![allow(bad_style, improper_ctypes, unused, deprecated)] -extern crate libc; use libc::*; #[cfg(any(target_os = "linux", target_os = "android"))] diff --git a/libc-test/test/linux_if_arp.rs b/libc-test/test/linux_if_arp.rs index 50be071d45b67..dc96aef738d04 100644 --- a/libc-test/test/linux_if_arp.rs +++ b/libc-test/test/linux_if_arp.rs @@ -1,6 +1,5 @@ #![allow(bad_style, improper_ctypes, unused, deprecated)] -extern crate libc; use libc::*; #[cfg(any(target_os = "linux", target_os = "android"))] diff --git a/libc-test/test/linux_ipv6.rs b/libc-test/test/linux_ipv6.rs index 83c389ce16a03..0f72646dcf55d 100644 --- a/libc-test/test/linux_ipv6.rs +++ b/libc-test/test/linux_ipv6.rs @@ -1,6 +1,5 @@ #![allow(bad_style, improper_ctypes, unused, deprecated)] -extern crate libc; use libc::*; #[cfg(target_os = "linux")] diff --git a/libc-test/test/linux_kernel_version.rs b/libc-test/test/linux_kernel_version.rs index c5687edad5601..767b0db257a46 100644 --- a/libc-test/test/linux_kernel_version.rs +++ b/libc-test/test/linux_kernel_version.rs @@ -1,7 +1,5 @@ //! Compare libc's KERNEL_VERSION macro against a specific kernel version. -extern crate libc; - #[cfg( target_os = "linux", )] diff --git a/libc-test/test/linux_strerror_r.rs b/libc-test/test/linux_strerror_r.rs index 17db959d8cb93..b4f800789b4e9 100644 --- a/libc-test/test/linux_strerror_r.rs +++ b/libc-test/test/linux_strerror_r.rs @@ -1,6 +1,5 @@ #![allow(bad_style, improper_ctypes, unused, deprecated)] -extern crate libc; use libc::*; #[cfg(any(target_os = "linux", target_os = "android"))] diff --git a/libc-test/test/linux_termios.rs b/libc-test/test/linux_termios.rs index 703a9b9b25b0d..46026e44cc953 100644 --- a/libc-test/test/linux_termios.rs +++ b/libc-test/test/linux_termios.rs @@ -1,6 +1,5 @@ #![allow(bad_style, improper_ctypes, unused, deprecated)] -extern crate libc; use libc::*; #[cfg(any(target_os = "linux", target_os = "android"))] diff --git a/libc-test/test/main.rs b/libc-test/test/main.rs index 62a587cf5868f..c3fdcb56e54df 100644 --- a/libc-test/test/main.rs +++ b/libc-test/test/main.rs @@ -1,5 +1,4 @@ #![allow(bad_style, improper_ctypes, deprecated)] -extern crate libc; use libc::*; diff --git a/libc-test/test/makedev.rs b/libc-test/test/makedev.rs index 6b5b85efb8197..cb00975b9a41f 100644 --- a/libc-test/test/makedev.rs +++ b/libc-test/test/makedev.rs @@ -1,8 +1,6 @@ //! Compare libc's makdev function against the actual C macros, for various //! inputs. -extern crate libc; - #[cfg(any( target_os = "android", target_os = "dragonfly", diff --git a/libc-test/test/semver.rs b/libc-test/test/semver.rs index bc7d1c9c7954c..5c9531169e08f 100644 --- a/libc-test/test/semver.rs +++ b/libc-test/test/semver.rs @@ -1,8 +1,6 @@ #![allow(unused_imports)] #![allow(deprecated)] -extern crate libc; - // Generated in `build.rs`. include!(concat!(env!("OUT_DIR"), "/semver.rs")); diff --git a/libc-test/test/sigrt.rs b/libc-test/test/sigrt.rs index 453dcb341d073..25e6ca4457b1b 100644 --- a/libc-test/test/sigrt.rs +++ b/libc-test/test/sigrt.rs @@ -1,7 +1,5 @@ //! Compare libc's SIGRTMAX and SIGRTMIN functions against the actual C macros -extern crate libc; - #[cfg(any( target_os = "linux", target_os = "l4re",