Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The asm! macro is not allowed in naked functions now #31

Closed
yct21 opened this issue Dec 8, 2024 · 1 comment
Closed

The asm! macro is not allowed in naked functions now #31

yct21 opened this issue Dec 8, 2024 · 1 comment

Comments

@yct21
Copy link

yct21 commented Dec 8, 2024

After this PR merged in nightly toolchain, asm! macro is not allowed in naked functions. This affects code in chapter 5.

~/code/Asynchronous-Programming-in-Rust/ch05/c-fibers > cargo +nightly run                              
   Compiling c-fibers v0.1.0 (/home/yct21/code/Asynchronous-Programming-in-Rust/ch05/c-fibers)
error[E0787]: the `asm!` macro is not allowed in naked functions
   --> src/main.rs:144:5
    |
144 |     asm!("ret", options(noreturn))
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ consider using the `naked_asm!` macro instead

error[E0787]: the `asm!` macro is not allowed in naked functions
   --> src/main.rs:158:5
    |
158 | /     asm!(
159 | |         "mov [rdi + 0x00], rsp",
160 | |         "mov [rdi + 0x08], r15",
161 | |         "mov [rdi + 0x10], r14",
...   |
174 | |         options(noreturn)
175 | |     );
    | |_____^ consider using the `naked_asm!` macro instead
@cfsamson
Copy link
Collaborator

Thank you for the heads up. I've updated the examples in the repository so it compiles correctly.

cfsamson added a commit that referenced this issue Dec 10, 2024
fixes #31. Migrate to `naked_asm` inside naked functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants