Skip to content

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

Closed
@yct21

Description

@yct21

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

Activity

added a commit that references this issue on Dec 9, 2024

fixes #31. Changes from using the macro inside naked function to sinc…

3cf7a78
cfsamson

cfsamson commented on Dec 10, 2024

@cfsamson
Collaborator

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

added a commit that references this issue on Dec 10, 2024

Merge pull request #32 from PacktPublishing/issue31

47b4f7d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @yct21@cfsamson

        Issue actions

          The `asm!` macro is not allowed in naked functions now · Issue #31 · PacktPublishing/Asynchronous-Programming-in-Rust