Skip to content

Commit 9a47b04

Browse files
authored
Upgrade rust-toolchain from 1.85.0 to 1.92.0 (#501)
1 parent a120fcc commit 9a47b04

File tree

11 files changed

+16
-14
lines changed

11 files changed

+16
-14
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version = "0.24.0"
55
license = "MIT"
66
authors = ["Nervos Core Dev <dev@nervos.org>"]
77
edition = "2024"
8-
rust-version = "1.85.0"
8+
rust-version = "1.92.0"
99
build = "build.rs"
1010
exclude = ["/benches", "/tests"]
1111
homepage = "https://github.com/nervosnetwork/ckb-vm"

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ clippy_rule = -D warnings \
2323
-D clippy::clone_on_ref_ptr \
2424
-D clippy::enum_glob_use \
2525
-A clippy::collapsible-else-if \
26+
-A clippy::collapsible_if \
2627
-A clippy::upper_case_acronyms \
2728
-A clippy::unusual_byte_groupings \
2829
-A clippy::inconsistent_digit_grouping \

definitions/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version = "0.24.0"
55
license = "MIT"
66
authors = ["Nervos Core Dev <dev@nervos.org>"]
77
edition = "2024"
8-
rust-version = "1.85.0"
8+
rust-version = "1.92.0"
99
autobins = false
1010
homepage = "https://github.com/nervosnetwork/ckb-vm"
1111
repository = "https://github.com/nervosnetwork/ckb-vm"

definitions/src/instructions.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ macro_rules! __for_each_inst_inner {
293293
/// a callback macro that takes (at least) 3 arguments:
294294
///
295295
/// 1. $name: an identifier containing the full defined opcode name,
296-
/// e.g., OP_ADD
296+
/// e.g., OP_ADD
297297
/// 2. $real_name: an identifier containing just the opcode part, e.g., ADD
298298
/// 3. $code: an expr containing the actual opcode number
299299
///
@@ -324,10 +324,10 @@ macro_rules! for_each_inst2 {
324324
/// arguments:
325325
///
326326
/// * A callback macro that takes the exact same arguments as callback
327-
/// macro in +for_each_inst+
327+
/// macro in +for_each_inst+
328328
/// * A value expression containing the actual value to match against.
329329
/// * An expression used as wildcard matches when the passed value does
330-
/// not match any opcode
330+
/// not match any opcode
331331
///
332332
/// * Free variables are attached to the variants ending with match1, match2, etc.
333333
#[macro_export]
@@ -357,7 +357,7 @@ macro_rules! for_each_inst_match2 {
357357
/// Generates an array on all instructions
358358
///
359359
/// * A callback macro that takes the exact same arguments as callback
360-
/// macro in +for_each_inst+
360+
/// macro in +for_each_inst+
361361
///
362362
/// * Free variables are attached to the variants ending with fold1, fold2, etc.
363363
#[macro_export]

rust-toolchain

Lines changed: 0 additions & 1 deletion
This file was deleted.

rust-toolchain.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[toolchain]
2+
channel = "1.92.0"

src/instructions/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ pub fn set_instruction_length_4(i: u64) -> u64 {
430430

431431
#[inline(always)]
432432
pub fn set_instruction_length_n(i: u64, n: u8) -> u64 {
433-
debug_assert!(n % 2 == 0);
433+
debug_assert!(n.is_multiple_of(2));
434434
debug_assert!(n <= 30);
435435
i | ((n as u64 & 0x1f) >> 1 << 24)
436436
}

src/machine/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ impl<Inner: SupportMachine, Decoder> DefaultMachine<Inner, Decoder> {
730730
self.initialize_stack(args, (memory_size - stack_size) as u64, stack_size as u64)?;
731731
// Make sure SP is 16 byte aligned
732732
if self.inner.version() >= VERSION1 {
733-
debug_assert!(self.registers()[SP].to_u64() % 16 == 0);
733+
debug_assert!(self.registers()[SP].to_u64().is_multiple_of(16));
734734
}
735735
Ok(stack_bytes)
736736
}

src/memory/flat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl<R: Register> Memory for FlatMemory<R> {
3636
type REG = R;
3737

3838
fn new(memory_size: usize) -> Self {
39-
assert!(memory_size % RISCV_PAGESIZE == 0);
39+
assert!(memory_size.is_multiple_of(RISCV_PAGESIZE));
4040
Self {
4141
data: vec![0; memory_size],
4242
flags: vec![0; memory_size / RISCV_PAGESIZE],

src/memory/sparse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl<R: Register> Memory for SparseMemory<R> {
7171
type REG = R;
7272

7373
fn new(memory_size: usize) -> Self {
74-
assert!(memory_size % RISCV_PAGESIZE == 0);
74+
assert!(memory_size.is_multiple_of(RISCV_PAGESIZE));
7575
Self {
7676
indices: vec![INVALID_PAGE_INDEX; memory_size / RISCV_PAGESIZE],
7777
pages: Vec::new(),

0 commit comments

Comments
 (0)