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 --- devices/src/lib.rs | 25 ------------------------- devices/src/usb/mod.rs | 2 -- devices/src/virtio/gpu/mod.rs | 4 ---- 3 files changed, 31 deletions(-) (limited to 'devices') diff --git a/devices/src/lib.rs b/devices/src/lib.rs index d28ea15..3b2c0b2 100644 --- a/devices/src/lib.rs +++ b/devices/src/lib.rs @@ -4,31 +4,6 @@ //! Emulates virtual and hardware devices. -extern crate audio_streams; -extern crate bit_field; -extern crate byteorder; -extern crate data_model; -extern crate enumn; -extern crate io_jail; -extern crate kvm; -extern crate libc; -extern crate msg_on_socket_derive; -extern crate msg_socket; -extern crate net_sys; -extern crate net_util; -extern crate p9; -extern crate remain; -extern crate resources; -extern crate sync; -#[macro_use] -extern crate sys_util; -#[cfg(feature = "tpm")] -extern crate tpm2; -extern crate usb_util; -extern crate vhost; -extern crate virtio_sys; -extern crate vm_control; - mod bus; mod cmos; mod i8042; diff --git a/devices/src/usb/mod.rs b/devices/src/usb/mod.rs index 738c693..dde6189 100644 --- a/devices/src/usb/mod.rs +++ b/devices/src/usb/mod.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 usb_util; - #[macro_use] mod log; pub mod host_backend; diff --git a/devices/src/virtio/gpu/mod.rs b/devices/src/virtio/gpu/mod.rs index a91b5b9..251b59c 100644 --- a/devices/src/virtio/gpu/mod.rs +++ b/devices/src/virtio/gpu/mod.rs @@ -2,10 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -extern crate gpu_buffer; -extern crate gpu_display; -extern crate gpu_renderer; - mod backend; mod protocol; -- cgit 1.4.1