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:
@@ -299,7 +299,7 @@ pub fn _print(args: fmt::Arguments) {
|
||||
```rust
|
||||
// in src/main.rs
|
||||
|
||||
#[no_mangle]
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn _start() -> ! {
|
||||
[…]
|
||||
loop {
|
||||
@@ -462,7 +462,7 @@ pub fn hlt_loop() -> ! {
|
||||
```rust
|
||||
// in src/main.rs
|
||||
|
||||
#[no_mangle]
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn _start() -> ! {
|
||||
[…]
|
||||
|
||||
@@ -487,7 +487,7 @@ fn panic(info: &PanicInfo) -> ! {
|
||||
|
||||
/// `cargo test`의 실행 시작 지점
|
||||
#[cfg(test)]
|
||||
#[no_mangle]
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn _start() -> ! {
|
||||
init();
|
||||
test_main();
|
||||
|
||||
Reference in New Issue
Block a user