diff --git a/arch-ops/src/x86.rs b/arch-ops/src/x86.rs index 369f8e4..89b1008 100644 --- a/arch-ops/src/x86.rs +++ b/arch-ops/src/x86.rs @@ -39,14 +39,10 @@ impl X86RegisterClass { } /// Whether or not register numbers >16 can be encoded using REX2 (else use EVEX) + #[allow(clippy::match_like_matches_macro)] // Match is easier to extend pub fn use_rex2(&self) -> bool { match self { - Self::ByteRex => true, - Self::Word => true, - Self::Double => true, - Self::Quad => true, - Self::Cr => true, - Self::Dr => true, + Self::ByteRex | Self::Word | Self::Double | Self::Quad | Self::Cr | Self::Dr => true, _ => false, } } diff --git a/arch-ops/src/x86/codegen.rs b/arch-ops/src/x86/codegen.rs index 8b5d17e..76c25b7 100644 --- a/arch-ops/src/x86/codegen.rs +++ b/arch-ops/src/x86/codegen.rs @@ -191,6 +191,7 @@ impl X86InstructionMap { #[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)] #[non_exhaustive] +#[allow(clippy::manual_non_exhaustive)] // See above pub enum X86EncodingPrefix { NoPrefix, Rex, @@ -914,6 +915,8 @@ impl _ => return false, // 2 top bits needs REX2 or EVEX } + // Match is easier to extend + #[allow(clippy::single_match)] match self.size { Some(X86RegisterClass::Zmm) => return false, // Need EVEX _ => {} @@ -1686,7 +1689,7 @@ impl X86Encoder { ), )) } - [oprs @ ..] => todo!("{:?}", oprs), + oprs => todo!("{:?}", oprs), }, X86EncodingMode::ModRMOp2(op) => todo!("{}", op), X86EncodingMode::OpReg(_) => todo!("+r"), diff --git a/binfmt/src/ar.rs b/binfmt/src/ar.rs index 1344922..7549e6c 100644 --- a/binfmt/src/ar.rs +++ b/binfmt/src/ar.rs @@ -268,6 +268,7 @@ impl Archive { } } + #[allow(clippy::unused_io_amount)] // FIXME: Ray wrote this code. Is this correct? pub fn ranlib(&mut self) -> &mut ArchiveMember { if self.symtab.is_none() { let mut symtab = ArchiveMember::new(); diff --git a/objdump/src/main.rs b/objdump/src/main.rs index a5147e9..a12c5d7 100644 --- a/objdump/src/main.rs +++ b/objdump/src/main.rs @@ -11,6 +11,7 @@ fn main() { let mut input_file = None::; + #[allow(clippy::never_loop)] // We need to handle more options than `--version` and `--help` while let Some(arg) = args.next() { match &*arg { "--version" => {