The no_mangle attribute is unsafe since Rust 2024

This commit is contained in:
Philipp Oppermann
2025-03-27 15:39:15 +01:00
parent 9345886d44
commit 9753695744
47 changed files with 149 additions and 149 deletions

View File

@@ -109,7 +109,7 @@ pub fn test_runner(tests: &[&dyn Fn()]) {
#![reexport_test_harness_main = "test_main"]
#[no_mangle]
#[unsafe(no_mangle)]
pub extern "C" fn _start() -> ! {
println!("Hello World{}", "!");
@@ -658,7 +658,7 @@ Rustにおける[結合テスト][integration tests]では、慣習としてプ
use core::panic::PanicInfo;
#[no_mangle] // この関数の名前を変えない
#[unsafe(no_mangle)] // この関数の名前を変えない
pub extern "C" fn _start() -> ! {
test_main();
@@ -740,7 +740,7 @@ pub fn test_panic_handler(info: &PanicInfo) -> ! {
/// `cargo test`のときのエントリポイント
#[cfg(test)]
#[no_mangle]
#[unsafe(no_mangle)]
pub extern "C" fn _start() -> ! {
test_main();
loop {}
@@ -806,7 +806,7 @@ pub mod vga_buffer;
use core::panic::PanicInfo;
use blog_os::println;
#[no_mangle]
#[unsafe(no_mangle)]
pub extern "C" fn _start() -> ! {
println!("Hello World{}", "!");
@@ -919,7 +919,7 @@ fn panic(_info: &PanicInfo) -> ! {
#![test_runner(test_runner)]
#![reexport_test_harness_main = "test_main"]
#[no_mangle]
#[unsafe(no_mangle)]
pub extern "C" fn _start() -> ! {
test_main();
@@ -992,7 +992,7 @@ harness = false
use core::panic::PanicInfo;
use blog_os::{exit_qemu, serial_print, serial_println, QemuExitCode};
#[no_mangle]
#[unsafe(no_mangle)]
pub extern "C" fn _start() -> ! {
should_fail();
serial_println!("[test did not panic]");