diff --git a/cranelift/codegen/src/ir/framelayout.rs b/cranelift/codegen/src/ir/framelayout.rs index 1b914a54f0..983b209279 100644 --- a/cranelift/codegen/src/ir/framelayout.rs +++ b/cranelift/codegen/src/ir/framelayout.rs @@ -56,7 +56,7 @@ pub struct FrameLayout { impl FrameLayout { /// Create instance of FrameLayout. pub fn new() -> Self { - FrameLayout { + Self { initial: vec![].into_boxed_slice(), instructions: HashMap::new(), } diff --git a/cranelift/codegen/src/isa/x86/binemit.rs b/cranelift/codegen/src/isa/x86/binemit.rs index fa67e5efff..5a373e6f96 100644 --- a/cranelift/codegen/src/isa/x86/binemit.rs +++ b/cranelift/codegen/src/isa/x86/binemit.rs @@ -64,7 +64,7 @@ fn rex3(rm: RegUnit, reg: RegUnit, index: RegUnit) -> u8 { /// Determines whether a REX prefix should be emitted. #[inline] fn needs_rex(bits: u16, rex: u8) -> bool { - rex != BASE_REX || u8::from(EncodingBits::from(bits).rex_w()) == 1 + rex != BASE_REX || EncodingBits::from(bits).rex_w() == 1 } // Emit a REX prefix. @@ -74,7 +74,7 @@ fn needs_rex(bits: u16, rex: u8) -> bool { fn rex_prefix(bits: u16, rex: u8, sink: &mut CS) { debug_assert_eq!(rex & 0xf8, BASE_REX); let w = EncodingBits::from(bits).rex_w(); - sink.put1(rex | (u8::from(w) << 3)); + sink.put1(rex | (w << 3)); } // Emit a single-byte opcode with no REX prefix. diff --git a/cranelift/codegen/src/simple_gvn.rs b/cranelift/codegen/src/simple_gvn.rs index 2130634c47..ff8696aee6 100644 --- a/cranelift/codegen/src/simple_gvn.rs +++ b/cranelift/codegen/src/simple_gvn.rs @@ -124,7 +124,8 @@ pub fn do_simple_gvn(func: &mut Function, domtree: &mut DominatorTree) { use crate::scoped_hash_map::Entry::*; match visible_values.entry(key) { Occupied(entry) => { - debug_assert!(domtree.dominates(*entry.get(), inst, &func.layout)); + let layout = &func.layout; + debug_assert!(domtree.dominates(*entry.get(), inst, layout)); // If the redundant instruction is representing the current // scope, pick a new representative. let old = scope_stack.last_mut().unwrap(); diff --git a/cranelift/wasm/src/environ/spec.rs b/cranelift/wasm/src/environ/spec.rs index 446a637020..71f22c8b39 100644 --- a/cranelift/wasm/src/environ/spec.rs +++ b/cranelift/wasm/src/environ/spec.rs @@ -306,6 +306,7 @@ pub trait FuncEnvironment: TargetEnvironment { /// The `index` provided identifies the linear memory to query, and `heap` is the heap reference /// returned by `make_heap` for the same index. `seg_index` is the index of the segment to copy /// from. + #[allow(clippy::too_many_arguments)] fn translate_memory_init( &mut self, pos: FuncCursor, @@ -329,6 +330,7 @@ pub trait FuncEnvironment: TargetEnvironment { ) -> WasmResult; /// Translate a `table.copy` WebAssembly instruction. + #[allow(clippy::too_many_arguments)] fn translate_table_copy( &mut self, pos: FuncCursor, @@ -342,6 +344,7 @@ pub trait FuncEnvironment: TargetEnvironment { ) -> WasmResult<()>; /// Translate a `table.init` WebAssembly instruction. + #[allow(clippy::too_many_arguments)] fn translate_table_init( &mut self, pos: FuncCursor,