Skip to content

Commit d096f28

Browse files
authored
chore: upgrade toolchain to nightly-2025-08-18 (#1069)
- upgrade toolchain to nightly-2025-08-18 - upgrade edition to 2024 (some previous used nightly features are stabilized)
1 parent db3c674 commit d096f28

File tree

34 files changed

+122
-114
lines changed

34 files changed

+122
-114
lines changed

.github/workflows/lints.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
components: rustfmt, clippy
2626
targets: riscv32im-unknown-none-elf
2727
# TODO: figure out way to keep this in sync with rust-toolchain.toml automatically
28-
toolchain: nightly-2025-03-25
28+
toolchain: nightly-2025-08-18
2929
- name: Cargo cache
3030
uses: actions/cache@v4
3131
with:

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
with:
2525
targets: riscv32im-unknown-none-elf
2626
# TODO: figure out way to keep this in sync with rust-toolchain.toml automatically
27-
toolchain: nightly-2025-03-25
27+
toolchain: nightly-2025-08-18
2828
- name: Cargo cache
2929
uses: actions/cache@v4
3030
with:

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resolver = "2"
1313

1414
[workspace.package]
1515
categories = ["cryptography", "zk", "blockchain", "ceno"]
16-
edition = "2021"
16+
edition = "2024"
1717
keywords = ["cryptography", "zk", "blockchain", "ceno"]
1818
license = "MIT OR Apache-2.0"
1919
readme = "README.md"

ceno_cli/example/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[workspace]
22
[package]
3-
edition = "2021"
3+
edition = "2024"
44
license = "MIT OR Apache-2.0"
55
name = "ceno_example"
66
version = "0.1.0"

ceno_emul/src/addr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl ByteAddr {
8989
}
9090

9191
pub const fn is_aligned(&self) -> bool {
92-
self.0 % WORD_SIZE as u32 == 0
92+
self.0.is_multiple_of(WORD_SIZE as u32)
9393
}
9494

9595
pub const fn is_null(&self) -> bool {

ceno_emul/src/elf.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl Program {
9797
.e_entry
9898
.try_into()
9999
.map_err(|err| anyhow!("e_entry was larger than 32 bits. {err}"))?;
100-
if entry >= max_mem || entry % WORD_SIZE as u32 != 0 {
100+
if entry >= max_mem || !entry.is_multiple_of(WORD_SIZE as u32) {
101101
bail!("Invalid entrypoint");
102102
}
103103
let segments = elf.segments().ok_or(anyhow!("Missing segment table"))?;
@@ -136,7 +136,7 @@ impl Program {
136136
return Err(anyhow!("only support one executable segment"));
137137
}
138138
}
139-
if vaddr % WORD_SIZE as u32 != 0 {
139+
if !vaddr.is_multiple_of(WORD_SIZE as u32) {
140140
bail!("vaddr {vaddr:08x} is unaligned");
141141
}
142142
tracing::debug!(
@@ -270,10 +270,11 @@ fn collect_addr_symbols_mapping<'data>(
270270

271271
if let Some((symtab, strtab)) = elf.symbol_table()? {
272272
for symbol in symtab.iter() {
273-
if let Ok(name) = strtab.get(symbol.st_name as usize) {
274-
if !name.is_empty() && symbol.st_value != 0 {
275-
symbols.insert(symbol.st_value, name.to_string());
276-
}
273+
if let Ok(name) = strtab.get(symbol.st_name as usize)
274+
&& !name.is_empty()
275+
&& symbol.st_value != 0
276+
{
277+
symbols.insert(symbol.st_value, name.to_string());
277278
}
278279
}
279280
}
@@ -286,5 +287,5 @@ fn find_max_symbol_in_range(
286287
start: u64,
287288
end: u64,
288289
) -> Option<(&u64, &String)> {
289-
symbols.range(start..end).max_by_key(|(&addr, _)| addr)
290+
symbols.range(start..end).max_by_key(|&(addr, _)| addr)
290291
}

ceno_emul/src/syscalls/keccak_permute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl From<[Word; KECCAK_WORDS]> for KeccakState {
2828
KeccakState(
2929
words
3030
.chunks_exact(2)
31-
.map(|chunk| (chunk[0] as u64 | ((chunk[1] as u64) << 32)))
31+
.map(|chunk| chunk[0] as u64 | ((chunk[1] as u64) << 32))
3232
.collect_vec()
3333
.try_into()
3434
.expect("failed to parse words into [u64; 25]"),

ceno_emul/src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ impl<'a, const LENGTH: usize> MemoryView<'a, LENGTH> {
1313
/// Creates a new memory segment view
1414
/// Asserts that `start` is a multiple of `WORD_SIZE`
1515
pub fn new(vm: &'a VMState, start: u32) -> Self {
16-
assert!(start % WORD_SIZE as u32 == 0);
16+
assert!(start.is_multiple_of(WORD_SIZE as u32));
1717
// TODO: do we need stricter alignment requirements for keccak (u64 array)
1818
MemoryView {
1919
vm,

ceno_rt/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
categories = ["cryptography", "zk", "blockchain", "ceno"]
33
description = "Ceno runtime library"
4-
edition = "2021"
4+
edition = "2024"
55
keywords = ["cryptography", "zk", "blockchain", "ceno"]
66
license = "MIT OR Apache-2.0"
77
name = "ceno_rt"

ceno_rt/riscv32im-ceno-zkvm-elf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"panic-strategy": "abort",
2727
"relocation-model": "static",
2828
"singlethread": true,
29-
"target-c-int-width": "32",
29+
"target-c-int-width": 32,
3030
"target-endian": "little",
3131
"target-pointer-width": "32"
3232
}

0 commit comments

Comments
 (0)