Skip to content

Commit 3e508d0

Browse files
authored
Return to rust v1.81 (#96)
1 parent 25e4119 commit 3e508d0

8 files changed

Lines changed: 16 additions & 14 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ members = [
88
[workspace.package]
99
authors = ["Aurora Labs <hello@aurora.dev>"]
1010
edition = "2021"
11-
version = "2.1.2"
11+
version = "2.1.3"
1212
description = "Aurora Ethereum Virtual Machine implementation written in pure Rust"
1313
categories = ["no-std", "compilers", "cryptography::cryptocurrencies"]
1414
keywords = ["aurora-evm", "evm", "ethereum", "blockchain", "no_std"]

evm/src/backend/memory.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl<'vicinity> MemoryBackend<'vicinity> {
9292
}
9393

9494
/// Get a mutable reference to the underlying `BTreeMap` storing the state.
95-
pub const fn state_mut(&mut self) -> &mut BTreeMap<H160, MemoryAccount> {
95+
pub fn state_mut(&mut self) -> &mut BTreeMap<H160, MemoryAccount> {
9696
&mut self.state
9797
}
9898
}
@@ -173,7 +173,7 @@ impl Backend for MemoryBackend<'_> {
173173
fn is_empty_storage(&self, address: H160) -> bool {
174174
self.state
175175
.get(&address)
176-
.is_none_or(|v| v.storage.is_empty())
176+
.map_or(true, |v| v.storage.is_empty())
177177
}
178178

179179
fn original_storage(&self, address: H160, index: H256) -> Option<H256> {

evm/src/core/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl Machine {
7474
&self.stack
7575
}
7676
/// Mutable reference of machine stack.
77-
pub const fn stack_mut(&mut self) -> &mut Stack {
77+
pub fn stack_mut(&mut self) -> &mut Stack {
7878
&mut self.stack
7979
}
8080
/// Reference of machine memory.
@@ -83,7 +83,7 @@ impl Machine {
8383
&self.memory
8484
}
8585
/// Mutable reference of machine memory.
86-
pub const fn memory_mut(&mut self) -> &mut Memory {
86+
pub fn memory_mut(&mut self) -> &mut Memory {
8787
&mut self.memory
8888
}
8989
/// Return a reference of the program counter.

evm/src/executor/stack/executor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ impl<'config> StackSubstateMetadata<'config> {
247247
&self.gasometer
248248
}
249249

250-
pub const fn gasometer_mut(&mut self) -> &mut Gasometer<'config> {
250+
pub fn gasometer_mut(&mut self) -> &mut Gasometer<'config> {
251251
&mut self.gasometer
252252
}
253253

@@ -445,7 +445,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet>
445445
&self.state
446446
}
447447

448-
pub const fn state_mut(&mut self) -> &mut S {
448+
pub fn state_mut(&mut self) -> &mut S {
449449
&mut self.state
450450
}
451451

evm/src/executor/stack/memory.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl<'config> MemoryStackSubstate<'config> {
4848
&self.logs
4949
}
5050

51-
pub const fn logs_mut(&mut self) -> &mut Vec<Log> {
51+
pub fn logs_mut(&mut self) -> &mut Vec<Log> {
5252
&mut self.logs
5353
}
5454

@@ -57,7 +57,7 @@ impl<'config> MemoryStackSubstate<'config> {
5757
&self.metadata
5858
}
5959

60-
pub const fn metadata_mut(&mut self) -> &mut StackSubstateMetadata<'config> {
60+
pub fn metadata_mut(&mut self) -> &mut StackSubstateMetadata<'config> {
6161
&mut self.metadata
6262
}
6363

@@ -316,7 +316,9 @@ impl<'config> MemoryStackSubstate<'config> {
316316
if local_is_accessed {
317317
false
318318
} else {
319-
self.parent.as_ref().is_none_or(|p| p.recursive_is_cold(f))
319+
self.parent
320+
.as_ref()
321+
.map_or(true, |p| p.recursive_is_cold(f))
320322
}
321323
}
322324

evm/src/runtime/eval/system.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ pub fn returndatacopy<H: Handler>(runtime: &mut Runtime) -> Control<H> {
204204
.resize_offset(memory_offset, len));
205205
if data_offset
206206
.checked_add(len.into())
207-
.is_none_or(|l| l > U256::from(runtime.return_data_buffer.len()))
207+
.map_or(true, |l| l > U256::from(runtime.return_data_buffer.len()))
208208
{
209209
return Control::Exit(ExitError::OutOfOffset.into());
210210
}

evm/src/runtime/interrupt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub struct ResolveCreate<'a> {
1414
}
1515

1616
impl<'a> ResolveCreate<'a> {
17-
pub(crate) const fn new(runtime: &'a mut Runtime) -> Self {
17+
pub(crate) fn new(runtime: &'a mut Runtime) -> Self {
1818
Self { _runtime: runtime }
1919
}
2020
}
@@ -25,7 +25,7 @@ pub struct ResolveCall<'a> {
2525
}
2626

2727
impl<'a> ResolveCall<'a> {
28-
pub(crate) const fn new(runtime: &'a mut Runtime) -> Self {
28+
pub(crate) fn new(runtime: &'a mut Runtime) -> Self {
2929
Self { _runtime: runtime }
3030
}
3131
}

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.87.0"
2+
channel = "1.81.0"
33
components = ["rustfmt", "clippy"]

0 commit comments

Comments
 (0)