diff --git a/CHANGELOG.md b/CHANGELOG.md index 35d2541971..ded1806c79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] -### Fixed +## Fixed +- [895](https://github.com/FuelLabs/fuel-vm/pull/895): Fix elided lifetimes compilation warnings that became errors after the release of rust 1.83.0. +- [895](https://github.com/FuelLabs/fuel-vm/pull/895): Bump proptest-derive to version `0.5.1` to fix non-local impl errors on the derivation of `proptest_derive::Arbitrary` introduced by rust 1.83.0. - [889](https://github.com/FuelLabs/fuel-vm/pull/889): Debugger breakpoint caused receipts to be produced incorrectly. ## [Version 0.59.1] diff --git a/fuel-merkle/Cargo.toml b/fuel-merkle/Cargo.toml index 35e60d1894..20c776a3a8 100644 --- a/fuel-merkle/Cargo.toml +++ b/fuel-merkle/Cargo.toml @@ -25,7 +25,7 @@ datatest-stable = "0.2" fuel-merkle-test-helpers = { path = "test-helpers" } hex = "0.4" proptest = "1.4" -proptest-derive = "0.4" +proptest-derive = "0.5.1" rand = "0.8" serde_json = "1.0" serde_yaml = "0.9" diff --git a/fuel-storage/src/impls.rs b/fuel-storage/src/impls.rs index 0f1517ae4c..91c54dbf21 100644 --- a/fuel-storage/src/impls.rs +++ b/fuel-storage/src/impls.rs @@ -15,9 +15,7 @@ use alloc::{ vec::Vec, }; -impl<'a, T: StorageInspect + ?Sized, Type: Mappable> StorageInspect - for &'a T -{ +impl + ?Sized, Type: Mappable> StorageInspect for &'_ T { type Error = T::Error; fn get( @@ -32,8 +30,8 @@ impl<'a, T: StorageInspect + ?Sized, Type: Mappable> StorageInspect } } -impl<'a, T: StorageInspect + ?Sized, Type: Mappable> StorageInspect - for &'a mut T +impl + ?Sized, Type: Mappable> StorageInspect + for &'_ mut T { type Error = T::Error; @@ -49,9 +47,7 @@ impl<'a, T: StorageInspect + ?Sized, Type: Mappable> StorageInspect } } -impl<'a, T: StorageMutate + ?Sized, Type: Mappable> StorageMutate - for &'a mut T -{ +impl + ?Sized, Type: Mappable> StorageMutate for &'_ mut T { fn insert( &mut self, key: &Type::Key, @@ -77,7 +73,7 @@ impl<'a, T: StorageMutate + ?Sized, Type: Mappable> StorageMutate } } -impl<'a, T: StorageSize + ?Sized, Type: Mappable> StorageSize for &'a T { +impl + ?Sized, Type: Mappable> StorageSize for &'_ T { fn size_of_value( &self, key: &::Key, @@ -86,7 +82,7 @@ impl<'a, T: StorageSize + ?Sized, Type: Mappable> StorageSize for &' } } -impl<'a, T: StorageSize + ?Sized, Type: Mappable> StorageSize for &'a mut T { +impl + ?Sized, Type: Mappable> StorageSize for &'_ mut T { fn size_of_value( &self, key: &::Key, @@ -95,8 +91,8 @@ impl<'a, T: StorageSize + ?Sized, Type: Mappable> StorageSize for &' } } -impl<'a, T: StorageRead + StorageSize + ?Sized, Type: Mappable> - StorageRead for &'a T +impl + StorageSize + ?Sized, Type: Mappable> StorageRead + for &'_ T { fn read( &self, @@ -115,8 +111,8 @@ impl<'a, T: StorageRead + StorageSize + ?Sized, Type: Mappable> } } -impl<'a, T: StorageRead + StorageSize + ?Sized, Type: Mappable> - StorageRead for &'a mut T +impl + StorageSize + ?Sized, Type: Mappable> StorageRead + for &'_ mut T { fn read( &self, @@ -135,9 +131,7 @@ impl<'a, T: StorageRead + StorageSize + ?Sized, Type: Mappable> } } -impl<'a, T: StorageWrite + ?Sized, Type: Mappable> StorageWrite - for &'a mut T -{ +impl + ?Sized, Type: Mappable> StorageWrite for &'_ mut T { fn write_bytes(&mut self, key: &Type::Key, buf: &[u8]) -> Result { >::write_bytes(self, key, buf) } @@ -155,16 +149,16 @@ impl<'a, T: StorageWrite + ?Sized, Type: Mappable> StorageWrite } } -impl<'a, T: MerkleRootStorage + ?Sized, Key, Type: Mappable> - MerkleRootStorage for &'a T +impl + ?Sized, Key, Type: Mappable> + MerkleRootStorage for &'_ T { fn root(&self, key: &Key) -> Result { >::root(self, key) } } -impl<'a, T: MerkleRootStorage + ?Sized, Key, Type: Mappable> - MerkleRootStorage for &'a mut T +impl + ?Sized, Key, Type: Mappable> + MerkleRootStorage for &'_ mut T { fn root(&self, key: &Key) -> Result { >::root(self, key) @@ -186,7 +180,7 @@ impl<'a, T: StorageInspect, Type: Mappable> StorageRef<'a, T, Type> { } } -impl<'a, T, Type: Mappable> StorageRef<'a, T, Type> { +impl StorageRef<'_, T, Type> { #[inline(always)] pub fn root(self, key: &Key) -> Result where @@ -196,7 +190,7 @@ impl<'a, T, Type: Mappable> StorageRef<'a, T, Type> { } } -impl<'a, T: StorageRead, Type: Mappable> StorageRef<'a, T, Type> { +impl, Type: Mappable> StorageRef<'_, T, Type> { #[inline(always)] pub fn read( &self, @@ -233,7 +227,7 @@ impl<'a, T: StorageInspect, Type: Mappable> StorageMut<'a, T, Type> { } } -impl<'a, T, Type> StorageMut<'a, T, Type> +impl StorageMut<'_, T, Type> where T: StorageMutate, Type: Mappable, @@ -263,7 +257,7 @@ where } } -impl<'a, T, Type: Mappable> StorageMut<'a, T, Type> { +impl StorageMut<'_, T, Type> { #[inline(always)] pub fn root(self, key: &Key) -> Result where @@ -273,7 +267,7 @@ impl<'a, T, Type: Mappable> StorageMut<'a, T, Type> { } } -impl<'a, T, Type> StorageMut<'a, T, Type> +impl StorageMut<'_, T, Type> where Type: Mappable, T: StorageWrite, diff --git a/fuel-tx/src/transaction.rs b/fuel-tx/src/transaction.rs index 69f67817a5..23de8f8837 100644 --- a/fuel-tx/src/transaction.rs +++ b/fuel-tx/src/transaction.rs @@ -984,13 +984,13 @@ pub mod field { pub(crate) storage_slots: &'a mut Vec, } - impl<'a> AsMut> for StorageSlotRef<'a> { + impl AsMut> for StorageSlotRef<'_> { fn as_mut(&mut self) -> &mut Vec { self.storage_slots } } - impl<'a> Deref for StorageSlotRef<'a> { + impl Deref for StorageSlotRef<'_> { type Target = [StorageSlot]; fn deref(&self) -> &Self::Target { @@ -998,14 +998,14 @@ pub mod field { } } - impl<'a> DerefMut for StorageSlotRef<'a> { + impl DerefMut for StorageSlotRef<'_> { fn deref_mut(&mut self) -> &mut Self::Target { self.storage_slots.deref_mut() } } /// Ensure the storage slots are sorted after being set - impl<'a> Drop for StorageSlotRef<'a> { + impl Drop for StorageSlotRef<'_> { fn drop(&mut self) { self.storage_slots.sort() } diff --git a/fuel-tx/src/transaction/policies.rs b/fuel-tx/src/transaction/policies.rs index 79ef8885dc..c7b78f100e 100644 --- a/fuel-tx/src/transaction/policies.rs +++ b/fuel-tx/src/transaction/policies.rs @@ -316,7 +316,7 @@ impl<'de> serde::Deserialize<'de> for Policies { Ignore, } struct FieldVisitor; - impl<'de> serde::de::Visitor<'de> for FieldVisitor { + impl serde::de::Visitor<'_> for FieldVisitor { type Value = Field; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/fuel-types/src/canonical.rs b/fuel-types/src/canonical.rs index 7cca2d286e..b9d131b9d1 100644 --- a/fuel-types/src/canonical.rs +++ b/fuel-types/src/canonical.rs @@ -481,7 +481,7 @@ impl Output for Vec { } } -impl<'a> Output for &'a mut [u8] { +impl Output for &'_ mut [u8] { fn write(&mut self, from: &[u8]) -> Result<(), Error> { if from.len() > self.len() { return Err(Error::BufferIsTooShort) @@ -498,7 +498,7 @@ impl<'a> Output for &'a mut [u8] { } } -impl<'a> Input for &'a [u8] { +impl Input for &'_ [u8] { fn remaining(&mut self) -> usize { self.len() } diff --git a/fuel-vm/src/constraints/reg_key.rs b/fuel-vm/src/constraints/reg_key.rs index ca80f5055e..5c179eaa05 100644 --- a/fuel-vm/src/constraints/reg_key.rs +++ b/fuel-vm/src/constraints/reg_key.rs @@ -109,14 +109,14 @@ impl<'a, const INDEX: u8> From> for Reg<'a, INDEX> { } } -impl<'r, const INDEX: u8> RegMut<'r, INDEX> { +impl RegMut<'_, INDEX> { /// Re-borrow the register as an immutable reference. pub fn as_ref(&self) -> Reg { Reg(self.0) } } -impl<'r, const INDEX: u8> RegMut<'r, INDEX> { +impl RegMut<'_, INDEX> { /// Re-borrow the register as a mutable reference. pub fn as_mut(&mut self) -> RegMut { RegMut(self.0) @@ -271,7 +271,7 @@ pub(crate) fn copy_registers( out } -impl<'r> ProgramRegisters<'r> { +impl ProgramRegisters<'_> { /// Get two mutable references to program registers. /// Note they cannot be the same register. pub fn get_mut_two( @@ -425,7 +425,7 @@ pub(crate) enum ProgramRegistersSegment { High, } -impl<'r> ProgramRegisters<'r> { +impl ProgramRegisters<'_> { /// Returns the registers corresponding to the segment, always 24 elements. pub(crate) fn segment(&self, segment: ProgramRegistersSegment) -> &[Word] { match segment { diff --git a/fuel-vm/src/interpreter/blockchain.rs b/fuel-vm/src/interpreter/blockchain.rs index 28e276aead..d296ff52c8 100644 --- a/fuel-vm/src/interpreter/blockchain.rs +++ b/fuel-vm/src/interpreter/blockchain.rs @@ -573,7 +573,7 @@ struct LoadContractCodeCtx<'vm, S> { is: Reg<'vm, IS>, } -impl<'vm, S> LoadContractCodeCtx<'vm, S> +impl LoadContractCodeCtx<'_, S> where S: InterpreterStorage, { @@ -874,7 +874,7 @@ struct BurnCtx<'vm, S> { is: Reg<'vm, IS>, } -impl<'vm, S> BurnCtx<'vm, S> +impl BurnCtx<'_, S> where S: ContractsAssetsStorage, { @@ -914,7 +914,7 @@ struct MintCtx<'vm, S> { is: Reg<'vm, IS>, } -impl<'vm, S> MintCtx<'vm, S> +impl MintCtx<'_, S> where S: ContractsAssetsStorage, { @@ -969,7 +969,7 @@ struct CodeCopyCtx<'vm, S> { is: Reg<'vm, IS>, } -impl<'vm, S> CodeCopyCtx<'vm, S> +impl CodeCopyCtx<'_, S> where S: InterpreterStorage, { @@ -1081,7 +1081,7 @@ struct CodeRootCtx<'vm, S> { is: Reg<'vm, IS>, } -impl<'vm, S> CodeRootCtx<'vm, S> { +impl CodeRootCtx<'_, S> { pub(crate) fn code_root(mut self, a: Word, b: Word) -> IoResult<(), S::DataError> where S: InterpreterStorage, @@ -1133,7 +1133,7 @@ struct CodeSizeCtx<'vm, S> { is: Reg<'vm, IS>, } -impl<'vm, S> CodeSizeCtx<'vm, S> { +impl CodeSizeCtx<'_, S> { pub(crate) fn code_size( mut self, result: &mut Word, diff --git a/fuel-vm/src/interpreter/contract.rs b/fuel-vm/src/interpreter/contract.rs index f57b44cc03..ce276a973b 100644 --- a/fuel-vm/src/interpreter/contract.rs +++ b/fuel-vm/src/interpreter/contract.rs @@ -185,7 +185,7 @@ struct ContractBalanceCtx<'vm, S> { input_contracts: InputContracts<'vm>, } -impl<'vm, S> ContractBalanceCtx<'vm, S> { +impl ContractBalanceCtx<'_, S> { pub(crate) fn contract_balance( mut self, result: &mut Word, @@ -225,7 +225,7 @@ struct TransferCtx<'vm, S, Tx> { pc: RegMut<'vm, PC>, } -impl<'vm, S, Tx> TransferCtx<'vm, S, Tx> { +impl TransferCtx<'_, S, Tx> { /// In Fuel specs: /// Transfer $rB coins with asset ID at $rC to contract with ID at $rA. /// $rA -> recipient_contract_id_offset diff --git a/fuel-vm/src/interpreter/executors/main.rs b/fuel-vm/src/interpreter/executors/main.rs index 3ef04a2f76..2905f2afd0 100644 --- a/fuel-vm/src/interpreter/executors/main.rs +++ b/fuel-vm/src/interpreter/executors/main.rs @@ -126,7 +126,7 @@ enum PredicateRunKind<'a, Tx> { Estimating(&'a mut Tx), } -impl<'a, Tx> PredicateRunKind<'a, Tx> { +impl PredicateRunKind<'_, Tx> { fn tx(&self) -> &Tx { match self { PredicateRunKind::Verifying(tx) => tx, diff --git a/fuel-vm/src/interpreter/flow.rs b/fuel-vm/src/interpreter/flow.rs index 2b75aebe3b..936f1f5233 100644 --- a/fuel-vm/src/interpreter/flow.rs +++ b/fuel-vm/src/interpreter/flow.rs @@ -437,7 +437,7 @@ struct PrepareCallUnusedRegisters<'a> { retl: Reg<'a, RETL>, } -impl<'a> PrepareCallRegisters<'a> { +impl PrepareCallRegisters<'_> { fn copy_registers(&self) -> [Word; VM_REGISTER_COUNT] { copy_registers(&self.into(), &self.program_registers) } @@ -459,7 +459,7 @@ struct PrepareCallCtx<'vm, S> { profiler: &'vm mut Profiler, } -impl<'vm, S> PrepareCallCtx<'vm, S> +impl PrepareCallCtx<'_, S> where S: InterpreterStorage, { diff --git a/fuel-vm/src/interpreter/gas.rs b/fuel-vm/src/interpreter/gas.rs index 62ef1dcb6f..eb6afeb14c 100644 --- a/fuel-vm/src/interpreter/gas.rs +++ b/fuel-vm/src/interpreter/gas.rs @@ -157,7 +157,7 @@ pub(crate) struct ProfileGas<'a> { pub profiler: &'a mut Profiler, } -impl<'a> ProfileGas<'a> { +impl ProfileGas<'_> { #[allow(unused_variables)] pub(crate) fn profile(&mut self, cgas: Reg, gas: Word) { #[cfg(feature = "profile-coverage")] diff --git a/fuel-vm/src/interpreter/receipts.rs b/fuel-vm/src/interpreter/receipts.rs index 4940f8b0a8..6d4b3e0acd 100644 --- a/fuel-vm/src/interpreter/receipts.rs +++ b/fuel-vm/src/interpreter/receipts.rs @@ -153,7 +153,7 @@ impl<'a> ReceiptsCtxMut<'a> { } } -impl<'a> Drop for ReceiptsCtxMut<'a> { +impl Drop for ReceiptsCtxMut<'_> { fn drop(&mut self) { // The receipts may have been modified; recalculate the root self.receipts_ctx.recalculate_root() diff --git a/fuel-vm/src/profiler.rs b/fuel-vm/src/profiler.rs index 2e09d90e12..1ecf54b1ec 100644 --- a/fuel-vm/src/profiler.rs +++ b/fuel-vm/src/profiler.rs @@ -38,7 +38,7 @@ impl serde::Serialize for InstructionLocation { struct InstructionLocationVisitor; #[cfg(feature = "serde")] -impl<'de> serde::de::Visitor<'de> for InstructionLocationVisitor { +impl serde::de::Visitor<'_> for InstructionLocationVisitor { type Value = InstructionLocation; fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { diff --git a/fuel-vm/src/state.rs b/fuel-vm/src/state.rs index 0fa840670e..d9189326ab 100644 --- a/fuel-vm/src/state.rs +++ b/fuel-vm/src/state.rs @@ -203,7 +203,7 @@ impl<'a, Tx> From<&'a StateTransition> for StateTransitionRef<'a, Tx> { } } -impl<'a, Tx: Clone> From> for StateTransition { +impl From> for StateTransition { fn from(t: StateTransitionRef) -> StateTransition { StateTransition { state: *t.state(),