mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-20 16:07:49 +00:00
The no_mangle attribute is unsafe since Rust 2024
This commit is contained in:
@@ -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]");
|
||||
|
||||
Reference in New Issue
Block a user