From 20773ba4905c4a4a4c9d0d70d64bb9c8f65bb5fb Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Thu, 21 Nov 2024 15:44:26 +0100 Subject: [PATCH] chore: clippy --- crates/revmc-cli/benches/iai.rs | 2 +- crates/revmc-cranelift/src/lib.rs | 4 ++-- crates/revmc-llvm/src/lib.rs | 14 +++++++------- crates/revmc-llvm/src/orc.rs | 2 +- crates/revmc/src/compiler/translate.rs | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/crates/revmc-cli/benches/iai.rs b/crates/revmc-cli/benches/iai.rs index f7ffece..7a9d933 100644 --- a/crates/revmc-cli/benches/iai.rs +++ b/crates/revmc-cli/benches/iai.rs @@ -25,7 +25,7 @@ fn setup_group(group: &mut BinaryBenchmarkGroup) { args.push("1"); // args.extend(["1", "--shared-library", so.to_str().unwrap()]); } - let mut bench = Bench::new(name); + let mut bench = Bench::new(name.replace('-', "_")); bench.command(Command::new(CMD).args(&args)).config(BinaryBenchmarkConfig::default()); if !is_ct { diff --git a/crates/revmc-cranelift/src/lib.rs b/crates/revmc-cranelift/src/lib.rs index 880fb18..2242f3c 100644 --- a/crates/revmc-cranelift/src/lib.rs +++ b/crates/revmc-cranelift/src/lib.rs @@ -285,7 +285,7 @@ pub struct EvmCraneliftBuilder<'a> { symbols: Symbols, } -impl<'a> BackendTypes for EvmCraneliftBuilder<'a> { +impl BackendTypes for EvmCraneliftBuilder<'_> { type Type = ::Type; type Value = ::Value; type StackSlot = ::StackSlot; @@ -293,7 +293,7 @@ impl<'a> BackendTypes for EvmCraneliftBuilder<'a> { type Function = ::Function; } -impl<'a> TypeMethods for EvmCraneliftBuilder<'a> { +impl TypeMethods for EvmCraneliftBuilder<'_> { fn type_ptr(&self) -> Self::Type { self.ptr_type } diff --git a/crates/revmc-llvm/src/lib.rs b/crates/revmc-llvm/src/lib.rs index 3c7f4c4..e14c377 100644 --- a/crates/revmc-llvm/src/lib.rs +++ b/crates/revmc-llvm/src/lib.rs @@ -218,7 +218,7 @@ impl<'ctx> BackendTypes for EvmLlvmBackend<'ctx> { type Function = FunctionValue<'ctx>; } -impl<'ctx> TypeMethods for EvmLlvmBackend<'ctx> { +impl TypeMethods for EvmLlvmBackend<'_> { fn type_ptr(&self) -> Self::Type { self.ty_ptr.into() } @@ -446,7 +446,7 @@ pub struct EvmLlvmBuilder<'a, 'ctx> { function: FunctionValue<'ctx>, } -impl<'a, 'ctx> std::ops::Deref for EvmLlvmBuilder<'a, 'ctx> { +impl<'ctx> std::ops::Deref for EvmLlvmBuilder<'_, 'ctx> { type Target = EvmLlvmBackend<'ctx>; #[inline] @@ -455,14 +455,14 @@ impl<'a, 'ctx> std::ops::Deref for EvmLlvmBuilder<'a, 'ctx> { } } -impl<'a, 'ctx> std::ops::DerefMut for EvmLlvmBuilder<'a, 'ctx> { +impl std::ops::DerefMut for EvmLlvmBuilder<'_, '_> { #[inline] fn deref_mut(&mut self) -> &mut Self::Target { self.backend } } -impl<'a, 'ctx> EvmLlvmBuilder<'a, 'ctx> { +impl<'ctx> EvmLlvmBuilder<'_, 'ctx> { #[allow(dead_code)] fn extract_value( &mut self, @@ -564,7 +564,7 @@ impl<'a, 'ctx> EvmLlvmBuilder<'a, 'ctx> { } } -impl<'a, 'ctx> BackendTypes for EvmLlvmBuilder<'a, 'ctx> { +impl<'ctx> BackendTypes for EvmLlvmBuilder<'_, 'ctx> { type Type = as BackendTypes>::Type; type Value = as BackendTypes>::Value; type StackSlot = as BackendTypes>::StackSlot; @@ -572,7 +572,7 @@ impl<'a, 'ctx> BackendTypes for EvmLlvmBuilder<'a, 'ctx> { type Function = as BackendTypes>::Function; } -impl<'a, 'ctx> TypeMethods for EvmLlvmBuilder<'a, 'ctx> { +impl TypeMethods for EvmLlvmBuilder<'_, '_> { fn type_ptr(&self) -> Self::Type { self.backend.type_ptr() } @@ -594,7 +594,7 @@ impl<'a, 'ctx> TypeMethods for EvmLlvmBuilder<'a, 'ctx> { } } -impl<'a, 'ctx> Builder for EvmLlvmBuilder<'a, 'ctx> { +impl Builder for EvmLlvmBuilder<'_, '_> { fn create_block(&mut self, name: &str) -> Self::BasicBlock { self.cx.append_basic_block(self.function, name) } diff --git a/crates/revmc-llvm/src/orc.rs b/crates/revmc-llvm/src/orc.rs index ac52bb1..2ad104b 100644 --- a/crates/revmc-llvm/src/orc.rs +++ b/crates/revmc-llvm/src/orc.rs @@ -789,7 +789,7 @@ pub struct ExecutionSessionRef<'ee> { _marker: PhantomData<&'ee ()>, } -impl<'ee> ExecutionSessionRef<'ee> { +impl ExecutionSessionRef<'_> { /// Wraps a raw pointer. pub unsafe fn from_inner(es: LLVMOrcExecutionSessionRef) -> Self { Self { es, _marker: PhantomData } diff --git a/crates/revmc/src/compiler/translate.rs b/crates/revmc/src/compiler/translate.rs index 0802aeb..fa4c6cc 100644 --- a/crates/revmc/src/compiler/translate.rs +++ b/crates/revmc/src/compiler/translate.rs @@ -1752,7 +1752,7 @@ impl<'a, B: Backend> FunctionCx<'a, B> { } /// IR builtins. -impl<'a, B: Backend> FunctionCx<'a, B> { +impl FunctionCx<'_, B> { fn call_byte(&mut self, index: B::Value, value: B::Value) -> B::Value { self.call_ir_binop_builtin("byte", index, value, Self::build_byte) }