From 9f0d66fb6ba35c76efea557b36d6fca35af09705 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 1 Mar 2024 21:34:29 +0100 Subject: [PATCH 1/2] switch to the nightly compiler from 1st of March --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index cc385f3187..881a9e2524 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2024-02-15" +channel = "nightly-2024-03-01" components = [ "llvm-tools", "rust-src", From 90fb82e00306a674b6ec03898ec89203dfa53c5c Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 1 Mar 2024 21:40:39 +0100 Subject: [PATCH 2/2] remove clippy warnings --- src/arch/x86_64/kernel/processor.rs | 2 +- src/arch/x86_64/mm/paging.rs | 2 +- src/drivers/net/virtio_net.rs | 1 - src/drivers/virtio/env.rs | 1 - src/drivers/virtio/transport/mmio.rs | 2 -- src/drivers/virtio/transport/pci.rs | 1 - src/scheduler/mod.rs | 2 +- 7 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/arch/x86_64/kernel/processor.rs b/src/arch/x86_64/kernel/processor.rs index 32d2605385..dafbdf1f5d 100644 --- a/src/arch/x86_64/kernel/processor.rs +++ b/src/arch/x86_64/kernel/processor.rs @@ -944,7 +944,7 @@ pub fn seed_entropy() -> Option<[u8; 32]> { // flag was incorrectly set without there actually being a random value // available. Even though no bugs are known for RDSEED, we should not // consider the default values random for extra security. - while unsafe { _rdseed64_step(&mut value) != 1 } || value == 0 || value == !0 { + while unsafe { _rdseed64_step(&mut value) != 1 } || value == 0 || value == u64::MAX { // Spin as per the recommendation in the // IntelĀ® Digital Random Number Generator (DRNG) implementation guide spin_loop(); diff --git a/src/arch/x86_64/mm/paging.rs b/src/arch/x86_64/mm/paging.rs index c7bb30ac7a..ea38d22ff3 100644 --- a/src/arch/x86_64/mm/paging.rs +++ b/src/arch/x86_64/mm/paging.rs @@ -182,7 +182,7 @@ pub fn map( /// Maps `count` pages at address `virt_addr`. If the allocation of a physical memory failed, /// the number of successfull mapped pages are returned as error value. -pub fn map_heap(virt_addr: VirtAddr, count: usize) -> Result<(), usize> +pub fn map_heap(virt_addr: VirtAddr, count: usize) -> Result<(), usize> where S: PageSize + Debug, RecursivePageTable<'static>: Mapper, diff --git a/src/drivers/net/virtio_net.rs b/src/drivers/net/virtio_net.rs index a94f4e73fe..3d79d9dc98 100644 --- a/src/drivers/net/virtio_net.rs +++ b/src/drivers/net/virtio_net.rs @@ -8,7 +8,6 @@ use alloc::vec::Vec; use core::cell::RefCell; use core::cmp::Ordering; use core::mem; -use core::result::Result; use align_address::Align; use pci_types::InterruptLine; diff --git a/src/drivers/virtio/env.rs b/src/drivers/virtio/env.rs index fb043629b0..dbd4bd0e50 100644 --- a/src/drivers/virtio/env.rs +++ b/src/drivers/virtio/env.rs @@ -179,7 +179,6 @@ pub mod memory { #[cfg(feature = "pci")] pub mod pci { use alloc::vec::Vec; - use core::result::Result; use pci_types::{Bar, MAX_BARS}; diff --git a/src/drivers/virtio/transport/mmio.rs b/src/drivers/virtio/transport/mmio.rs index ee6873a49b..a99fce483c 100644 --- a/src/drivers/virtio/transport/mmio.rs +++ b/src/drivers/virtio/transport/mmio.rs @@ -3,9 +3,7 @@ //! The module contains ... #![allow(dead_code)] -use core::convert::TryInto; use core::ptr::{read_volatile, write_volatile}; -use core::result::Result; use core::sync::atomic::{fence, Ordering}; use core::{ptr, u8}; diff --git a/src/drivers/virtio/transport/pci.rs b/src/drivers/virtio/transport/pci.rs index 631b782d59..5ab2fbdc86 100644 --- a/src/drivers/virtio/transport/pci.rs +++ b/src/drivers/virtio/transport/pci.rs @@ -4,7 +4,6 @@ #![allow(dead_code)] use alloc::vec::Vec; -use core::result::Result; use core::sync::atomic::{fence, Ordering}; use core::{mem, ptr}; diff --git a/src/scheduler/mod.rs b/src/scheduler/mod.rs index cce4e5768c..fdae67a5da 100644 --- a/src/scheduler/mod.rs +++ b/src/scheduler/mod.rs @@ -16,7 +16,7 @@ use core::task::Poll::Ready; use ahash::RandomState; use crossbeam_utils::Backoff; use hashbrown::HashMap; -use hermit_sync::{without_interrupts, *}; +use hermit_sync::*; #[cfg(target_arch = "riscv64")] use riscv::register::sstatus;