From aecf9a4dee6c004bceabf268a5b36d24c3744ca6 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 11 Apr 2019 14:30:00 -0700 Subject: edition: Remove extern crate lines In Rust 2018 edition, `extern crate` is no longer required for importing from other crates. Instead of writing: extern crate dep; use dep::Thing; we write: use dep::Thing; In this approach, macros are imported individually from the declaring crate rather than through #[macro_use]. Before: #[macro_use] extern crate sys_util; After: use sys_util::{debug, error}; The only place that `extern crate` continues to be required is in importing the compiler's proc_macro API into a procedural macro crate. This will hopefully be fixed in a future Rust release. extern crate proc_macro; TEST=cargo check TEST=cargo check --all-features TEST=cargo check --target aarch64-unknown-linux-gnu TEST=local kokoro Change-Id: I0b43768c0d81f2a250b1959fb97ba35cbac56293 Reviewed-on: https://chromium-review.googlesource.com/1565302 Commit-Ready: David Tolnay Commit-Ready: ChromeOS CL Exonerator Bot Tested-by: David Tolnay Tested-by: kokoro Reviewed-by: David Tolnay --- sys_util/poll_token_derive/poll_token_derive.rs | 3 --- sys_util/src/capabilities.rs | 2 -- sys_util/src/lib.rs | 10 ---------- 3 files changed, 15 deletions(-) (limited to 'sys_util') diff --git a/sys_util/poll_token_derive/poll_token_derive.rs b/sys_util/poll_token_derive/poll_token_derive.rs index 582016b..7b7baac 100644 --- a/sys_util/poll_token_derive/poll_token_derive.rs +++ b/sys_util/poll_token_derive/poll_token_derive.rs @@ -5,9 +5,6 @@ #![recursion_limit = "128"] extern crate proc_macro; -extern crate proc_macro2; -extern crate quote; -extern crate syn; use proc_macro2::{Ident, TokenStream}; use quote::quote; diff --git a/sys_util/src/capabilities.rs b/sys_util/src/capabilities.rs index 5f42ab8..90b8784 100644 --- a/sys_util/src/capabilities.rs +++ b/sys_util/src/capabilities.rs @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -extern crate libc; - use libc::{c_int, c_void}; use crate::{errno_result, Result}; diff --git a/sys_util/src/lib.rs b/sys_util/src/lib.rs index d62ec48..a1dffea 100644 --- a/sys_util/src/lib.rs +++ b/sys_util/src/lib.rs @@ -4,14 +4,6 @@ //! Small system utility modules for usage by other modules. -extern crate data_model; -extern crate libc; -extern crate syscall_defines; -#[allow(unused_imports)] -#[macro_use] -extern crate poll_token_derive; -extern crate sync; - pub mod affinity; #[macro_use] pub mod handle_eintr; @@ -226,8 +218,6 @@ pub fn fallocate( /// Reaps all child processes until there are no terminated children to reap. /// /// ``` -/// # extern crate libc; -/// # extern crate sys_util; /// fn reap_children() { /// loop { /// match sys_util::reap_child() { -- cgit 1.4.1