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

@@ -254,7 +254,7 @@ pub fn print_something() {
```rust
// in src/main.rs
#[no_mangle]
#[unsafe(no_mangle)]
pub extern "C" fn _start() -> ! {
vga_buffer::print_something();
loop {}
@@ -523,7 +523,7 @@ lazy_static! {
```rust
// in src/main.rs
#[no_mangle]
#[unsafe(no_mangle)]
pub extern "C" fn _start() -> ! {
use core::fmt::Write;
vga_buffer::WRITER.lock().write_str("Hello again").unwrap();
@@ -606,7 +606,7 @@ pub fn _print(args: fmt::Arguments) {
```rust
// in src/main.rs
#[no_mangle]
#[unsafe(no_mangle)]
pub extern "C" fn _start() {
println!("Hello World{}", "!");