Skip to content

Discourage use of static mut in singleton #389

@EvansJahja

Description

@EvansJahja

The code in this part about Singleton no longer works as of Rust 2024

https://docs.rust-embedded.org/book/peripherals/singletons.html

static mut PERIPHERALS: Peripherals = Peripherals {
    serial: Some(SerialPort),
};

giving error instead of warning "mutable reference to mutable static"

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