Skip to content

The no_mangle attribute is unsafe in Rust Edition 2024 #945

@anders-zpt

Description

@anders-zpt

svd2rust generates a #[no_mangle] attribute. This attribute is unsafe in Rust Edition 2024. The code compiles in Rust Edition 2021.

error: unsafe attribute used without unsafe
   --> device/src/lib.rs:715:3
    |
715 | #[no_mangle] static mut DEVICE_PERIPHERALS : bool = false ;
    |   ^^^^^^^^^ usage of unsafe attribute
    |
help: wrap the attribute in `unsafe(...)`
    |
715 | #[unsafe(no_mangle)] static mut DEVICE_PERIPHERALS : bool = false ;
    |   +++++++         +

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

    Issue actions