Skip to content

svd2rust: --edition=2024 missing unsafe block for setting DEVICE_PERIPHERALS #1

@kurtjd

Description

@kurtjd

svd2rust generates:

#[unsafe(no_mangle)]
static mut DEVICE_PERIPHERALS: bool = false;

and later:

DEVICE_PERIPHERALS = true;

but in 2024 edition the above line requires an explicit unsafe block since #[warn(unsafe_op_in_unsafe_fn)] is on by default:

unsafe { DEVICE_PERIPHERALS = true; }

which should be applied when the --edition=2024 flag is used.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions