From b3ff5c7835c869019a037679f08005b069c6077c Mon Sep 17 00:00:00 2001 From: Yuuki Takano Date: Tue, 21 Jul 2026 12:28:37 +0900 Subject: [PATCH 1/4] fix: use Rust nightly 2026-07-20 Signed-off-by: Yuuki Takano --- .vscode/settings.json | 12 ++++++------ Makefile | 2 +- awkernel_drivers/src/pcie/intel/ixgbe.rs | 15 +++++---------- awkernel_lib/src/arch/x86_64/delay.rs | 4 ++-- awkernel_lib/src/arch/x86_64/kvm/pvclock.rs | 2 +- awkernel_lib/src/file/fatfs/dir_entry.rs | 6 ++---- awkernel_lib/src/net/if_net.rs | 2 +- docker/Dockerfile | 4 ++-- smoltcp/src/socket/tcp.rs | 9 ++++----- 9 files changed, 24 insertions(+), 32 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 4aa7fe420..a73d830c8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,7 +11,7 @@ // ], // "rust-analyzer.check.overrideCommand": [ // "cargo", - // "+nightly-2026-06-13", + // "+nightly-2026-07-20", // "check_no_std", // "--target=targets/aarch64-kernel.json", // ], @@ -21,13 +21,13 @@ // For x86_64 "rust-analyzer.cargo.buildScripts.overrideCommand": [ "cargo", - "+nightly-2026-06-13", + "+nightly-2026-07-20", "check_no_std", "--target=targets/x86_64-kernel.json", ], "rust-analyzer.check.overrideCommand": [ "cargo", - "+nightly-2026-06-13", + "+nightly-2026-07-20", "check_no_std", "--target=targets/x86_64-kernel.json", ], @@ -37,14 +37,14 @@ // For Linux // "rust-analyzer.cargo.buildScripts.overrideCommand": [ // "cargo", - // "+nightly-2026-06-13", + // "+nightly-2026-07-20", // "check_std", // "--quiet", // "--message-format=json" // ], // "rust-analyzer.check.overrideCommand": [ // "cargo", - // "+nightly-2026-06-13", + // "+nightly-2026-07-20", // "check_std", // "--quiet", // "--message-format=json" @@ -52,4 +52,4 @@ // "rust-analyzer.cargo.features": [ // "std" // ], -} \ No newline at end of file +} diff --git a/Makefile b/Makefile index 7fbf698ec..545b4099e 100644 --- a/Makefile +++ b/Makefile @@ -55,7 +55,7 @@ X86_64_LD=$(LINKERDIR)/x86_64-link.lds RV32_LD=$(LINKERDIR)/rv32-link.lds RV64_LD=$(LINKERDIR)/rv64-link.lds -RUSTV=nightly-2026-06-13 +RUSTV=nightly-2026-07-20 all: aarch64 x86_64 riscv32 riscv64 std diff --git a/awkernel_drivers/src/pcie/intel/ixgbe.rs b/awkernel_drivers/src/pcie/intel/ixgbe.rs index b7e944748..eeda0c80a 100644 --- a/awkernel_drivers/src/pcie/intel/ixgbe.rs +++ b/awkernel_drivers/src/pcie/intel/ixgbe.rs @@ -1831,21 +1831,16 @@ impl Ixgbe { // Pluggable optics-related interrupt if inner.is_sfp() { - let mod_mask; - let msf_mask; - if inner.info.get_id() == IXGBE_DEV_ID_X550EM_X_SFP { - mod_mask = IXGBE_EICR_GPI_SDP0_X540; - msf_mask = IXGBE_EICR_GPI_SDP1_X540; + let (mod_mask, msf_mask) = if inner.info.get_id() == IXGBE_DEV_ID_X550EM_X_SFP { + (IXGBE_EICR_GPI_SDP0_X540, IXGBE_EICR_GPI_SDP1_X540) } else if inner.hw.mac.mac_type == MacType::IxgbeMacX540 || inner.hw.mac.mac_type == MacType::IxgbeMacX550 || inner.hw.mac.mac_type == MacType::IxgbeMacX550EMX { - mod_mask = IXGBE_EICR_GPI_SDP2_X540; - msf_mask = IXGBE_EICR_GPI_SDP1_X540; + (IXGBE_EICR_GPI_SDP2_X540, IXGBE_EICR_GPI_SDP1_X540) } else { - mod_mask = IXGBE_EICR_GPI_SDP2; - msf_mask = IXGBE_EICR_GPI_SDP1; - } + (IXGBE_EICR_GPI_SDP2, IXGBE_EICR_GPI_SDP1) + }; if reg_eicr & mod_mask != 0 { // Clear the interrupt ixgbe_hw::write_reg(&inner.info, IXGBE_EICR, mod_mask)?; diff --git a/awkernel_lib/src/arch/x86_64/delay.rs b/awkernel_lib/src/arch/x86_64/delay.rs index d48e0874f..3dd5ffd33 100644 --- a/awkernel_lib/src/arch/x86_64/delay.rs +++ b/awkernel_lib/src/arch/x86_64/delay.rs @@ -345,7 +345,7 @@ fn cpu_x_wait_tx(msg: i64) { #[inline(always)] fn cpu_x_get_tx() -> i64 { loop { - match CHANNEL_CPU0_TX.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |x| { + match CHANNEL_CPU0_TX.try_update(Ordering::Relaxed, Ordering::Relaxed, |x| { if x != MSG_NULL { Some(MSG_NULL) } else { @@ -362,7 +362,7 @@ fn cpu_x_get_tx() -> i64 { #[inline(always)] fn cpu_0_get_rx() -> i64 { loop { - match CHANNEL_CPU0_RX.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |x| { + match CHANNEL_CPU0_RX.try_update(Ordering::Relaxed, Ordering::Relaxed, |x| { if x != MSG_NULL { Some(MSG_NULL) } else { diff --git a/awkernel_lib/src/arch/x86_64/kvm/pvclock.rs b/awkernel_lib/src/arch/x86_64/kvm/pvclock.rs index 8e290c280..bf4dee737 100644 --- a/awkernel_lib/src/arch/x86_64/kvm/pvclock.rs +++ b/awkernel_lib/src/arch/x86_64/kvm/pvclock.rs @@ -163,7 +163,7 @@ pub(crate) fn uptime_nano() -> Option { return Some(ctr); } - if let Err(prev) = PVCLOCK_LAST_COUNT.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |n| { + if let Err(prev) = PVCLOCK_LAST_COUNT.try_update(Ordering::Relaxed, Ordering::Relaxed, |n| { if n < ctr { Some(ctr) } else { diff --git a/awkernel_lib/src/file/fatfs/dir_entry.rs b/awkernel_lib/src/file/fatfs/dir_entry.rs index 4902aa3d2..ee3108889 100644 --- a/awkernel_lib/src/file/fatfs/dir_entry.rs +++ b/awkernel_lib/src/file/fatfs/dir_entry.rs @@ -2,7 +2,6 @@ use alloc::string::String; use alloc::sync::Arc; use bitflags::bitflags; use core::char; -use core::convert::TryInto; use core::fmt::{self, Debug}; #[cfg(not(feature = "unicode"))] use core::iter; @@ -417,9 +416,8 @@ impl DirEntryData { }; // divide the name into order and LFN name_0 data.order = name[0]; - for (dst, src) in data.name_0.iter_mut().zip(name[1..].chunks_exact(2)) { - // unwrap cannot panic because src has exactly 2 values - *dst = u16::from_le_bytes(src.try_into().unwrap()); + for (dst, src) in data.name_0.iter_mut().zip(name[1..].as_chunks::<2>().0) { + *dst = u16::from_le_bytes(*src); } data.entry_type = rdr.read_u8()?; diff --git a/awkernel_lib/src/net/if_net.rs b/awkernel_lib/src/net/if_net.rs index bd4f4f761..a0c5cac0c 100644 --- a/awkernel_lib/src/net/if_net.rs +++ b/awkernel_lib/src/net/if_net.rs @@ -514,7 +514,7 @@ impl IfNet { // If some task will poll, this task need not to poll. if self .will_poll - .fetch_update(Ordering::Relaxed, Ordering::Relaxed, |n| { + .try_update(Ordering::Relaxed, Ordering::Relaxed, |n| { if n > 0 { None } else { diff --git a/docker/Dockerfile b/docker/Dockerfile index e98da2ad9..06eaf4924 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -16,8 +16,8 @@ RUN . /usr/local/cargo/env && \ cargo install mdbook-mermaid RUN . /usr/local/cargo/env && \ - rustup toolchain install nightly-2026-06-13 && \ - rustup default nightly-2026-06-13 && \ + rustup toolchain install nightly-2026-07-20 && \ + rustup default nightly-2026-07-20 && \ rustup component add rust-src llvm-tools-preview && \ rustup target add x86_64-unknown-none aarch64-unknown-none riscv32imac-unknown-none-elf diff --git a/smoltcp/src/socket/tcp.rs b/smoltcp/src/socket/tcp.rs index 6b9f642a2..8c626f561 100644 --- a/smoltcp/src/socket/tcp.rs +++ b/smoltcp/src/socket/tcp.rs @@ -2237,14 +2237,13 @@ impl<'a> Socket<'a> { // has expired, and we also have data in transmit buffer. Since any packet that occupies // sequence space will elicit an ACK, we only need to send an explicit packet if we // couldn't fill the sequence space with anything. - let is_keep_alive; - if self.timer.should_keep_alive(cx.now()) && repr.is_empty() { + let is_keep_alive = if self.timer.should_keep_alive(cx.now()) && repr.is_empty() { repr.seq_number = repr.seq_number - 1; repr.payload = b"\x00"; // RFC 1122 says we should do this - is_keep_alive = true; + true } else { - is_keep_alive = false; - } + false + }; // Trace a summary of what will be sent. if is_keep_alive { From 437cebe836ae2080dd1e4aa46b2ce3a04999dbc2 Mon Sep 17 00:00:00 2001 From: Yuuki Takano Date: Tue, 21 Jul 2026 12:32:00 +0900 Subject: [PATCH 2/4] use nightly-2026-07-20 Signed-off-by: Yuuki Takano --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4415290eb..ea6e99032 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -19,9 +19,9 @@ jobs: - uses: actions/checkout@v3 - name: Install Rust nightly - run: rustup toolchain install nightly-2026-06-13 + run: rustup toolchain install nightly-2026-07-20 - name: Use Rust nightly - run: rustup default nightly-2026-06-13 + run: rustup default nightly-2026-07-20 - name: Add Rust components run: rustup component add rust-src llvm-tools-preview clippy rustfmt - name: Add Rust targets From 12808cbca1a90276decb1dd8c40b7aa342d0a909 Mon Sep 17 00:00:00 2001 From: Yuuki Takano Date: Thu, 23 Jul 2026 00:31:54 +0900 Subject: [PATCH 3/4] update README.md Signed-off-by: Yuuki Takano --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 86ce92c13..e1808d687 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ It can execute async/await applications in kernel space safely. ```text $ sudo apt install clang qemu-system-arm qemu-system-x86 qemu-system-misc python3-pyelftools -$ rustup toolchain install nightly-2026-06-13 -$ rustup default nightly-2026-06-13 +$ rustup toolchain install nightly-2026-07-20 +$ rustup default nightly-2026-07-20 $ rustup component add rust-src llvm-tools-preview $ rustup target add x86_64-unknown-none aarch64-unknown-none riscv64gc-unknown-none-elf riscv32imac-unknown-none-elf ``` From 9f66c6490d5de59e4f44545d3f0c493364af113e Mon Sep 17 00:00:00 2001 From: Yuuki Takano Date: Thu, 23 Jul 2026 13:40:31 +0900 Subject: [PATCH 4/4] fix .vscode/settings.json also Signed-off-by: Yuuki Takano --- .vscode/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index a73d830c8..44a84d156 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,7 +5,7 @@ // For AArch64 Virt // "rust-analyzer.cargo.buildScripts.overrideCommand": [ // "cargo", - // "+nightly-2026-06-13", + // "+nightly-2026-07-20", // "check_no_std", // "--target=targets/aarch64-kernel.json", // ],