summary refs log tree commit diff
path: root/sys_util
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@chromium.org>2019-04-11 14:30:00 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-04-15 02:06:08 -0700
commitaecf9a4dee6c004bceabf268a5b36d24c3744ca6 (patch)
treef43a4fae670c5e3366d30d405b8f603d44a6464f /sys_util
parent633426a8fc20a5eef402e159d53228aae13bbaa5 (diff)
downloadcrosvm-aecf9a4dee6c004bceabf268a5b36d24c3744ca6.tar
crosvm-aecf9a4dee6c004bceabf268a5b36d24c3744ca6.tar.gz
crosvm-aecf9a4dee6c004bceabf268a5b36d24c3744ca6.tar.bz2
crosvm-aecf9a4dee6c004bceabf268a5b36d24c3744ca6.tar.lz
crosvm-aecf9a4dee6c004bceabf268a5b36d24c3744ca6.tar.xz
crosvm-aecf9a4dee6c004bceabf268a5b36d24c3744ca6.tar.zst
crosvm-aecf9a4dee6c004bceabf268a5b36d24c3744ca6.zip
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 <dtolnay@chromium.org>
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
Diffstat (limited to 'sys_util')
-rw-r--r--sys_util/poll_token_derive/poll_token_derive.rs3
-rw-r--r--sys_util/src/capabilities.rs2
-rw-r--r--sys_util/src/lib.rs10
3 files changed, 0 insertions, 15 deletions
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() {