Skip to content

Commit f200e17

Browse files
committed
ch05: use stablized naked_functions feature
The `naked_functions` feature was stabilized in rust-lang/rust#134213. Update the code to use this stabilized feature.
1 parent 47b4f7d commit f200e17

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ch05/c-fibers/src/main.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
///
77
/// See: https://github.com/PacktPublishing/Asynchronous-Programming-in-Rust/issues/31
88
/// for more information.
9-
#![feature(naked_functions)]
109
use std::arch::{asm, naked_asm};
1110

1211
const DEFAULT_STACK_SIZE: usize = 1024 * 1024 * 2;
@@ -147,7 +146,7 @@ fn guard() {
147146
};
148147
}
149148

150-
#[naked]
149+
#[unsafe(naked)]
151150
unsafe extern "C" fn skip() {
152151
naked_asm!("ret")
153152
}
@@ -159,7 +158,7 @@ pub fn yield_thread() {
159158
};
160159
}
161160

162-
#[naked]
161+
#[unsafe(naked)]
163162
#[no_mangle]
164163
#[cfg_attr(target_os = "macos", export_name = "\x01switch")] // see: How-to-MacOS-M.md for explanation
165164
unsafe extern "C" fn switch() {

0 commit comments

Comments
 (0)