From 6ead120fb8853f639f3d5a392053cdeee1c0dedc Mon Sep 17 00:00:00 2001 From: Evgeny Ukhanov Date: Wed, 11 Sep 2024 10:21:56 +0200 Subject: [PATCH] Update rust-1.81.0 (#61) --- evm-tests/ethjson/src/bytes.rs | 2 +- evm-tests/ethjson/src/spec/spec.rs | 9 ++++++--- evm-tests/ethjson/src/test_helpers/skip.rs | 2 +- evm-tests/jsontests/src/state.rs | 6 ++++-- rust-toolchain.toml | 2 +- src/backend/memory.rs | 5 ++++- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/evm-tests/ethjson/src/bytes.rs b/evm-tests/ethjson/src/bytes.rs index 8f761b616..4e3c59537 100644 --- a/evm-tests/ethjson/src/bytes.rs +++ b/evm-tests/ethjson/src/bytes.rs @@ -29,7 +29,7 @@ pub struct Bytes(Vec); impl Bytes { /// Creates bytes struct. - pub fn new(v: Vec) -> Self { + pub const fn new(v: Vec) -> Self { Self(v) } } diff --git a/evm-tests/ethjson/src/spec/spec.rs b/evm-tests/ethjson/src/spec/spec.rs index a02a34fd9..926669345 100644 --- a/evm-tests/ethjson/src/spec/spec.rs +++ b/evm-tests/ethjson/src/spec/spec.rs @@ -81,12 +81,15 @@ impl ForkSpec { | Self::HomesteadToEIP150At5 | Self::ByzantiumToConstantinopleFixAt5 | Self::ConstantinopleFixToIstanbulAt5 - | Self::EIP150 | Self::EIP158 - | Self::Frontier | Self::Homestead + | Self::EIP150 + | Self::EIP158 + | Self::Frontier + | Self::Homestead | Self::Byzantium | Self::Constantinople | Self::ConstantinopleFix - | Self::Istanbul | Self::Berlin + | Self::Istanbul + | Self::Berlin ) } } diff --git a/evm-tests/ethjson/src/test_helpers/skip.rs b/evm-tests/ethjson/src/test_helpers/skip.rs index 38a319383..71fcfcf32 100644 --- a/evm-tests/ethjson/src/test_helpers/skip.rs +++ b/evm-tests/ethjson/src/test_helpers/skip.rs @@ -63,7 +63,7 @@ pub struct StateSkipSubStates { impl SkipTests { /// Empty skip states. - pub fn empty() -> Self { + pub const fn empty() -> Self { Self { block: Vec::new(), state: Vec::new(), diff --git a/evm-tests/jsontests/src/state.rs b/evm-tests/jsontests/src/state.rs index e099b9e9a..7fa8c4365 100644 --- a/evm-tests/jsontests/src/state.rs +++ b/evm-tests/jsontests/src/state.rs @@ -1107,10 +1107,12 @@ fn test_run( spec, ForkSpec::EIP150 | ForkSpec::EIP158 | ForkSpec::Frontier - | ForkSpec::Homestead | ForkSpec::Byzantium + | ForkSpec::Homestead + | ForkSpec::Byzantium | ForkSpec::Constantinople | ForkSpec::ConstantinopleFix - | ForkSpec::Istanbul | ForkSpec::Berlin + | ForkSpec::Istanbul + | ForkSpec::Berlin ) && TxType::from_txbytes(&state.txbytes) != TxType::Legacy && state.expect_exception.as_deref() == Some("TR_TypeNotSupported"); if expect_tx_type_not_supported { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index cbc2eb034..0f102b72a 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.80.0" +channel = "1.81.0" profile = "minimal" components = ["rustfmt", "clippy"] diff --git a/src/backend/memory.rs b/src/backend/memory.rs index 2592aa46d..619897d62 100644 --- a/src/backend/memory.rs +++ b/src/backend/memory.rs @@ -73,7 +73,10 @@ pub struct MemoryBackend<'vicinity> { impl<'vicinity> MemoryBackend<'vicinity> { /// Create a new memory backend. #[must_use] - pub fn new(vicinity: &'vicinity MemoryVicinity, state: BTreeMap) -> Self { + pub const fn new( + vicinity: &'vicinity MemoryVicinity, + state: BTreeMap, + ) -> Self { Self { vicinity, state,