Adjust for Rust unstable feature's stability change

This commit is contained in:
Zhang Junyang 2024-06-20 15:55:36 +00:00 committed by Tate, Hongliang Tian
parent 5c524348de
commit ab1d931cb7
9 changed files with 21 additions and 19 deletions

View File

@ -69,20 +69,23 @@ impl PciDeviceLocation {
/// Returns an iterator that enumerates all possible PCI device locations. /// Returns an iterator that enumerates all possible PCI device locations.
pub fn all() -> impl Iterator<Item = PciDeviceLocation> { pub fn all() -> impl Iterator<Item = PciDeviceLocation> {
iter::from_coroutine(|| { iter::from_coroutine(
for bus in Self::MIN_BUS..=Self::MAX_BUS { #[coroutine]
for device in Self::MIN_DEVICE..=Self::MAX_DEVICE { || {
for function in Self::MIN_FUNCTION..=Self::MAX_FUNCTION { for bus in Self::MIN_BUS..=Self::MAX_BUS {
let loc = PciDeviceLocation { for device in Self::MIN_DEVICE..=Self::MAX_DEVICE {
bus, for function in Self::MIN_FUNCTION..=Self::MAX_FUNCTION {
device, let loc = PciDeviceLocation {
function, bus,
}; device,
yield loc; function,
};
yield loc;
}
} }
} }
} },
}) )
} }
/// The page table of all devices is the same. So we can use any device ID. /// The page table of all devices is the same. So we can use any device ID.

View File

@ -15,7 +15,6 @@
#![feature(panic_info_message)] #![feature(panic_info_message)]
#![feature(ptr_sub_ptr)] #![feature(ptr_sub_ptr)]
#![feature(strict_provenance)] #![feature(strict_provenance)]
#![feature(pointer_is_aligned)]
// 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.
#![allow(incomplete_features)] #![allow(incomplete_features)]

View File

@ -30,7 +30,7 @@ use unwinding::{
#[export_name = "__aster_panic_handler"] #[export_name = "__aster_panic_handler"]
pub fn panic_handler(info: &core::panic::PanicInfo) -> ! { pub fn panic_handler(info: &core::panic::PanicInfo) -> ! {
let throw_info = ktest::PanicInfo { let throw_info = ktest::PanicInfo {
message: info.message().unwrap().to_string(), message: info.message().to_string(),
file: info.location().unwrap().file().to_string(), file: info.location().unwrap().file().to_string(),
line: info.location().unwrap().line() as usize, line: info.location().unwrap().line() as usize,
col: info.location().unwrap().column() as usize, col: info.location().unwrap().column() as usize,

View File

@ -8,7 +8,6 @@
//! currently not needed by Asterinas. //! currently not needed by Asterinas.
//! //!
#![feature(offset_of)]
#![cfg_attr(not(test), no_std)] #![cfg_attr(not(test), no_std)]
/// Magic stored in the boot protocol header. /// Magic stored in the boot protocol header.

View File

@ -5,5 +5,5 @@ rustflags = [
"-Ctarget-feature=+crt-static", "-Ctarget-feature=+crt-static",
"-Zplt=yes", "-Zplt=yes",
"-Zrelax-elf-relocations=yes", "-Zrelax-elf-relocations=yes",
"-Zrelro-level=full", "-Crelro-level=full",
] ]

View File

@ -7,7 +7,6 @@
#![feature(btree_cursors)] #![feature(btree_cursors)]
#![feature(btree_extract_if)] #![feature(btree_extract_if)]
#![feature(const_option)] #![feature(const_option)]
#![feature(exclusive_range_pattern)]
#![feature(extend_one)] #![feature(extend_one)]
#![feature(fn_traits)] #![feature(fn_traits)]
#![feature(format_args_nl)] #![feature(format_args_nl)]
@ -21,6 +20,7 @@
#![feature(specialization)] #![feature(specialization)]
#![feature(step_trait)] #![feature(step_trait)]
#![feature(trait_alias)] #![feature(trait_alias)]
#![feature(trait_upcasting)]
#![register_tool(component_access_control)] #![register_tool(component_access_control)]
use aster_frame::{ use aster_frame::{

View File

@ -30,6 +30,7 @@
#![deny(unsafe_code)] #![deny(unsafe_code)]
#![feature(fn_traits)] #![feature(fn_traits)]
#![feature(step_trait)] #![feature(step_trait)]
#![feature(trait_upcasting)]
#![allow(dead_code)] #![allow(dead_code)]
extern crate alloc; extern crate alloc;

View File

@ -153,7 +153,7 @@ fn install_setup_with_arch(
let target_dir = std::fs::canonicalize(target_dir).unwrap(); let target_dir = std::fs::canonicalize(target_dir).unwrap();
let mut cmd = Command::new("cargo"); let mut cmd = Command::new("cargo");
cmd.env("RUSTFLAGS", "-Ccode-model=kernel -Crelocation-model=pie -Ctarget-feature=+crt-static -Zplt=yes -Zrelax-elf-relocations=yes -Zrelro-level=full"); cmd.env("RUSTFLAGS", "-Ccode-model=kernel -Crelocation-model=pie -Ctarget-feature=+crt-static -Zplt=yes -Zrelax-elf-relocations=yes -Crelro-level=full");
cmd.arg("install").arg("linux-bzimage-setup"); cmd.arg("install").arg("linux-bzimage-setup");
cmd.arg("--force"); cmd.arg("--force");
cmd.arg("--root").arg(install_dir.as_ref()); cmd.arg("--root").arg(install_dir.as_ref());

View File

@ -205,7 +205,7 @@ fn build_kernel_elf(
&env_rustflags, &env_rustflags,
&rustc_linker_script_arg, &rustc_linker_script_arg,
"-C relocation-model=static", "-C relocation-model=static",
"-Z relro-level=off", "-C relro-level=off",
// We do not really allow unwinding except for kernel testing. However, we need to specify // We do not really allow unwinding except for kernel testing. However, we need to specify
// this to show backtraces when panicking. // this to show backtraces when panicking.
"-C panic=unwind", "-C panic=unwind",