Skip to content

Rust Edition 2024 #374

@DrewRidley

Description

@DrewRidley

Hey all, super excited about the work you are doing for the future of wasm!

As of recently, I think a few days ago, Edition 2024 was officially released in Rust, and it seems like one of the biggest breaking changes made was the requirement of unsafe attributes for #[no_mangle] and #[link_section]

error: unsafe attribute used without unsafe
   --> src/bindings.rs:120:3
    |
120 | #[link_section = "component-type:wit-bindgen:0.36.0:example:compone...
    |   ^^^^^^^^^^^^ usage of unsafe attribute
    |
help: wrap the attribute in `unsafe(...)`
    |
120 | #[unsafe(link_section = "component-type:wit-bindgen:0.36.0:example:component:example:encoded world")]
    |   +++++++                             

Unfortunately as of late, the example code provided does not compile. Fortunately its a very easy fix (https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-attributes.html).

Let me know if I can help by getting a PR rolling to accommodate this change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions