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,7 +69,9 @@ impl PciDeviceLocation {
/// Returns an iterator that enumerates all possible PCI device locations.
pub fn all() -> impl Iterator<Item = PciDeviceLocation> {
iter::from_coroutine(|| {
iter::from_coroutine(
#[coroutine]
|| {
for bus in Self::MIN_BUS..=Self::MAX_BUS {
for device in Self::MIN_DEVICE..=Self::MAX_DEVICE {
for function in Self::MIN_FUNCTION..=Self::MAX_FUNCTION {
@ -82,7 +84,8 @@ impl PciDeviceLocation {
}
}
}
})
},
)
}
/// 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(ptr_sub_ptr)]
#![feature(strict_provenance)]
#![feature(pointer_is_aligned)]
// 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.
#![allow(incomplete_features)]

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -153,7 +153,7 @@ fn install_setup_with_arch(
let target_dir = std::fs::canonicalize(target_dir).unwrap();
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("--force");
cmd.arg("--root").arg(install_dir.as_ref());

View File

@ -205,7 +205,7 @@ fn build_kernel_elf(
&env_rustflags,
&rustc_linker_script_arg,
"-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
// this to show backtraces when panicking.
"-C panic=unwind",