Fix compile error caused by updated Step::steps_between in Rust

This commit is contained in:
Marsman1996 2024-11-30 18:58:18 +08:00 committed by Tate, Hongliang Tian
parent 5e35704e38
commit 6d3bb5a9d0
10 changed files with 14 additions and 18 deletions

14
Cargo.lock generated
View File

@ -920,7 +920,7 @@ dependencies = [
"uart_16550", "uart_16550",
"uefi", "uefi",
"uefi-raw", "uefi-raw",
"x86_64 0.15.1", "x86_64 0.15.2",
"xmas-elf 0.9.1", "xmas-elf 0.9.1",
] ]
@ -1162,7 +1162,7 @@ dependencies = [
"unwinding", "unwinding",
"volatile", "volatile",
"x86", "x86",
"x86_64 0.14.11", "x86_64 0.14.13",
"xarray", "xarray",
] ]
@ -1519,7 +1519,7 @@ dependencies = [
"iced-x86", "iced-x86",
"lazy_static", "lazy_static",
"raw-cpuid", "raw-cpuid",
"x86_64 0.14.11", "x86_64 0.14.13",
] ]
[[package]] [[package]]
@ -1776,9 +1776,9 @@ dependencies = [
[[package]] [[package]]
name = "x86_64" name = "x86_64"
version = "0.14.11" version = "0.14.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b835097a84e4457323331ec5d6eb23d096066cbfb215d54096dcb4b2e85f500" checksum = "c101112411baafbb4bf8d33e4c4a80ab5b02d74d2612331c61e8192fc9710491"
dependencies = [ dependencies = [
"bit_field", "bit_field",
"bitflags 2.6.0", "bitflags 2.6.0",
@ -1788,9 +1788,9 @@ dependencies = [
[[package]] [[package]]
name = "x86_64" name = "x86_64"
version = "0.15.1" version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4bc79523af8abf92fb1a970c3e086c5a343f6bcc1a0eb890f575cbb3b45743df" checksum = "0f042214de98141e9c8706e8192b73f56494087cc55ebec28ce10f26c5c364ae"
dependencies = [ dependencies = [
"bit_field", "bit_field",
"bitflags 2.6.0", "bitflags 2.6.0",

View File

@ -89,7 +89,7 @@ impl<const N: u16> Sub<u64> for BlockId<N> {
/// Implements the `Step` trait to iterate over `Range<Id>`. /// Implements the `Step` trait to iterate over `Range<Id>`.
impl<const N: u16> Step for BlockId<N> { impl<const N: u16> Step for BlockId<N> {
fn steps_between(start: &Self, end: &Self) -> Option<usize> { fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>) {
u64::steps_between(&start.0, &end.0) u64::steps_between(&start.0, &end.0)
} }

View File

@ -3,7 +3,6 @@
//! The framebuffer of Asterinas. //! The framebuffer of Asterinas.
#![no_std] #![no_std]
#![deny(unsafe_code)] #![deny(unsafe_code)]
#![feature(strict_provenance)]
extern crate alloc; extern crate alloc;

View File

@ -9,7 +9,6 @@
#![allow(incomplete_features)] #![allow(incomplete_features)]
#![feature(btree_cursors)] #![feature(btree_cursors)]
#![feature(btree_extract_if)] #![feature(btree_extract_if)]
#![feature(const_option)]
#![feature(extend_one)] #![feature(extend_one)]
#![feature(fn_traits)] #![feature(fn_traits)]
#![feature(format_args_nl)] #![feature(format_args_nl)]

View File

@ -108,9 +108,9 @@ fn do_select(
let mut poll_fds = Vec::with_capacity(nfds as usize); let mut poll_fds = Vec::with_capacity(nfds as usize);
for fd in 0..nfds { for fd in 0..nfds {
let events = { let events = {
let readable = readfds.as_ref().map_or(false, |fds| fds.is_set(fd)); let readable = readfds.as_ref().is_some_and(|fds| fds.is_set(fd));
let writable = writefds.as_ref().map_or(false, |fds| fds.is_set(fd)); let writable = writefds.as_ref().is_some_and(|fds| fds.is_set(fd));
let except = exceptfds.as_ref().map_or(false, |fds| fds.is_set(fd)); let except = exceptfds.as_ref().is_some_and(|fds| fds.is_set(fd));
convert_rwe_to_events(readable, writable, except) convert_rwe_to_events(readable, writable, except)
}; };

1
osdk/Cargo.lock generated
View File

@ -195,7 +195,6 @@ dependencies = [
"indexmap", "indexmap",
"indicatif", "indicatif",
"inferno", "inferno",
"lazy_static",
"linux-bzimage-builder", "linux-bzimage-builder",
"log", "log",
"quote", "quote",

View File

@ -1,5 +1,5 @@
# One should also update asterinas/rust-toolchain.toml when updating this. # One should also update asterinas/rust-toolchain.toml when updating this.
# The first two lines will be deleted when generating the user's toolchain file. # The first two lines will be deleted when generating the user's toolchain file.
[toolchain] [toolchain]
channel = "nightly-2024-10-12" channel = "nightly-2024-11-29"
components = ["rust-src", "rustc-dev", "llvm-tools-preview"] components = ["rust-src", "rustc-dev", "llvm-tools-preview"]

View File

@ -44,7 +44,7 @@ volatile = { version = "0.4.5", features = ["unstable"] }
xarray = { git = "https://github.com/asterinas/xarray", version = "0.1.0" } xarray = { git = "https://github.com/asterinas/xarray", version = "0.1.0" }
[target.x86_64-unknown-none.dependencies] [target.x86_64-unknown-none.dependencies]
x86_64 = "0.14.2" x86_64 = "0.14.13"
x86 = "0.52.0" x86 = "0.52.0"
acpi = "5.1.0" acpi = "5.1.0"
aml = "0.16.3" aml = "0.16.3"

View File

@ -16,7 +16,6 @@
#![feature(min_specialization)] #![feature(min_specialization)]
#![feature(negative_impls)] #![feature(negative_impls)]
#![feature(ptr_sub_ptr)] #![feature(ptr_sub_ptr)]
#![feature(strict_provenance)]
#![feature(sync_unsafe_cell)] #![feature(sync_unsafe_cell)]
// The `generic_const_exprs` feature is incomplete however required for the page table // The `generic_const_exprs` feature is incomplete however required for the page table
// const generic implementation. We are using this feature in a conservative manner. // const generic implementation. We are using this feature in a conservative manner.

View File

@ -1,6 +1,6 @@
# One should also update osdk/src/commands/new/rust-toolchain.toml.template # One should also update osdk/src/commands/new/rust-toolchain.toml.template
# when updating this # when updating this
[toolchain] [toolchain]
channel = "nightly-2024-10-12" channel = "nightly-2024-11-29"
components = ["rust-src", "rustc-dev", "llvm-tools-preview"] components = ["rust-src", "rustc-dev", "llvm-tools-preview"]
targets = ["x86_64-unknown-none"] targets = ["x86_64-unknown-none"]