From 1d0aa175319387fed046837ba8f69e5f8e4668dd Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 27 Mar 2025 15:50:07 +0100 Subject: [PATCH 1/2] Update tests to make `no_mangle` attribute `unsafe` Required since Rust 2024 edition --- tests/basic_boot.rs | 2 +- tests/should_panic.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/basic_boot.rs b/tests/basic_boot.rs index c409647e..4171eb7a 100644 --- a/tests/basic_boot.rs +++ b/tests/basic_boot.rs @@ -7,7 +7,7 @@ use blog_os::println; use core::panic::PanicInfo; -#[no_mangle] // don't mangle the name of this function +#[unsafe(no_mangle)] // don't mangle the name of this function pub extern "C" fn _start() -> ! { test_main(); diff --git a/tests/should_panic.rs b/tests/should_panic.rs index 375f51c0..f735259d 100644 --- a/tests/should_panic.rs +++ b/tests/should_panic.rs @@ -1,10 +1,10 @@ #![no_std] #![no_main] -use blog_os::{exit_qemu, serial_print, serial_println, QemuExitCode}; +use blog_os::{QemuExitCode, exit_qemu, serial_print, serial_println}; use core::panic::PanicInfo; -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn _start() -> ! { should_fail(); serial_println!("[test did not panic]"); From 5b088bffeb2a84344bd5dd10c0ff157d74af65bc Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 27 Mar 2025 15:51:13 +0100 Subject: [PATCH 2/2] Update `stack_overflow` test to use unsafe `no_mangle` attribute Required since Rust 2024 edition --- tests/stack_overflow.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/stack_overflow.rs b/tests/stack_overflow.rs index de826f38..1e97ae01 100644 --- a/tests/stack_overflow.rs +++ b/tests/stack_overflow.rs @@ -2,12 +2,12 @@ #![no_main] #![feature(abi_x86_interrupt)] -use blog_os::{exit_qemu, serial_print, serial_println, QemuExitCode}; +use blog_os::{QemuExitCode, exit_qemu, serial_print, serial_println}; use core::panic::PanicInfo; use lazy_static::lazy_static; use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame}; -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn _start() -> ! { serial_print!("stack_overflow::stack_overflow...\t");