summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@chromium.org>2019-04-12 15:40:20 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-04-15 02:06:09 -0700
commit967c2f2c9bce9e177f0eea3f1bb73d35d9c95922 (patch)
tree1b26a9925c15116ca16b3c2146df0edda45f9c62
parent79a2a2d7b44f1e49a83fdf527dd554f3bef704bc (diff)
downloadcrosvm-967c2f2c9bce9e177f0eea3f1bb73d35d9c95922.tar
crosvm-967c2f2c9bce9e177f0eea3f1bb73d35d9c95922.tar.gz
crosvm-967c2f2c9bce9e177f0eea3f1bb73d35d9c95922.tar.bz2
crosvm-967c2f2c9bce9e177f0eea3f1bb73d35d9c95922.tar.lz
crosvm-967c2f2c9bce9e177f0eea3f1bb73d35d9c95922.tar.xz
crosvm-967c2f2c9bce9e177f0eea3f1bb73d35d9c95922.tar.zst
crosvm-967c2f2c9bce9e177f0eea3f1bb73d35d9c95922.zip
clippy: Switch to tool attributes for suppressing lints
Tool attributes were stabilized in Rust 1.31:
https://blog.rust-lang.org/2018/12/06/Rust-1.31-and-rust-2018.html#tool-lints

Before:

    #[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment)]

After:

    #[allow(clippy::cast_ptr_alignment)]

TEST=cargo check --all-features

Change-Id: If2f1511f6231d60578b5e0d5bd4210a68eb08caf
Reviewed-on: https://chromium-review.googlesource.com/1566651
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>
-rw-r--r--kernel_loader/src/lib.rs2
-rw-r--r--kvm/src/lib.rs4
-rw-r--r--kvm_sys/src/lib.rs2
-rw-r--r--net_sys/src/lib.rs2
-rw-r--r--usb_util/src/lib.rs2
-rw-r--r--x86_64/src/lib.rs2
6 files changed, 7 insertions, 7 deletions
diff --git a/kernel_loader/src/lib.rs b/kernel_loader/src/lib.rs
index 66a8dfb..c11214f 100644
--- a/kernel_loader/src/lib.rs
+++ b/kernel_loader/src/lib.rs
@@ -13,7 +13,7 @@ use sys_util::{GuestAddress, GuestMemory};
 #[allow(non_camel_case_types)]
 #[allow(non_snake_case)]
 #[allow(non_upper_case_globals)]
-#[cfg_attr(feature = "cargo-clippy", allow(clippy))]
+#[allow(clippy::all)]
 mod elf;
 
 #[derive(Debug, PartialEq)]
diff --git a/kvm/src/lib.rs b/kvm/src/lib.rs
index 919aad3..16d73f1 100644
--- a/kvm/src/lib.rs
+++ b/kvm/src/lib.rs
@@ -1162,7 +1162,7 @@ impl Vcpu {
     ///
     /// This function should be called after `Vcpu::run` returns an `VcpuExit::IoIn` or
     /// `Vcpu::MmioRead`.
-    #[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
+    #[allow(clippy::cast_ptr_alignment)]
     pub fn set_data(&self, data: &[u8]) -> Result<()> {
         // Safe because we know we mapped enough memory to hold the kvm_run struct because the
         // kernel told us how large it was. The pointer is page aligned so casting to a different
@@ -1211,7 +1211,7 @@ impl Vcpu {
     ///
     /// Note that the state of the VCPU and associated VM must be setup first for this to do
     /// anything useful.
-    #[cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
+    #[allow(clippy::cast_ptr_alignment)]
     // The pointer is page aligned so casting to a different type is well defined, hence the clippy
     // allow attribute.
     pub fn run(&self) -> Result<VcpuExit> {
diff --git a/kvm_sys/src/lib.rs b/kvm_sys/src/lib.rs
index 9000b79..b9748a3 100644
--- a/kvm_sys/src/lib.rs
+++ b/kvm_sys/src/lib.rs
@@ -16,7 +16,7 @@ pub const KVM_EXIT_IO_OUT: ::std::os::raw::c_uint = 1;
 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
 pub mod x86 {
     // generated with bindgen /usr/include/linux/kvm.h --no-unstable-rust --constified-enum '*' --with-derive-default
-    #[cfg_attr(feature = "cargo-clippy", allow(clippy))]
+    #[allow(clippy::all)]
     pub mod bindings;
     pub use crate::bindings::*;
     use sys_util::{ioctl_ior_nr, ioctl_iow_nr, ioctl_iowr_nr};
diff --git a/net_sys/src/lib.rs b/net_sys/src/lib.rs
index 9df49e4..32013fc 100644
--- a/net_sys/src/lib.rs
+++ b/net_sys/src/lib.rs
@@ -15,7 +15,7 @@ use sys_util::{ioctl_ior_nr, ioctl_iow_nr};
 // Generated against Linux 4.11 to include fix "uapi: fix linux/if.h userspace
 // compilation errors".
 // Manual fixup of ifrn_name to be of type c_uchar instead of c_char.
-#[cfg_attr(feature = "cargo-clippy", allow(clippy))]
+#[allow(clippy::all)]
 pub mod iff;
 // generated with bindgen /usr/include/linux/if_tun.h --no-unstable-rust
 // --constified-enum '*' --with-derive-default
diff --git a/usb_util/src/lib.rs b/usb_util/src/lib.rs
index 8755428..07af5ad 100644
--- a/usb_util/src/lib.rs
+++ b/usb_util/src/lib.rs
@@ -7,7 +7,7 @@
 #![allow(non_camel_case_types)]
 #![allow(non_snake_case)]
 #![allow(non_upper_case_globals)]
-#[cfg_attr(feature = "cargo-clippy", allow(clippy))]
+#[allow(clippy::all)]
 mod bindings;
 
 #[macro_use]
diff --git a/x86_64/src/lib.rs b/x86_64/src/lib.rs
index 997ed40..faba584 100644
--- a/x86_64/src/lib.rs
+++ b/x86_64/src/lib.rs
@@ -35,7 +35,7 @@ mod msr_index;
 #[allow(dead_code)]
 #[allow(non_upper_case_globals)]
 #[allow(non_camel_case_types)]
-#[cfg_attr(feature = "cargo-clippy", allow(clippy))]
+#[allow(clippy::all)]
 mod mpspec;
 // These mpspec types are only data, reading them from data is a safe initialization.
 unsafe impl data_model::DataInit for mpspec::mpc_bus {}