Skip to content

Commit 3d7e14c

Browse files
committed
Add unsafe block around DEVICE_PERIPHERALS
1 parent 87c2fc4 commit 3d7e14c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
77

88
## [Unreleased]
99

10+
- Add unsafe block around `DEVICE_PERIPHERALS = true` in `Peripherals::steal()`
11+
to support Rust 2024 edition.
12+
1013
## [v0.37.0] - 2025-08-14
1114

1215
- Fix new `mismatched-lifetime-syntaxes` lint warnings

src/generate/device.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result<Toke
339339
/// Each of the returned peripherals must be used at most once.
340340
#[inline]
341341
pub unsafe fn steal() -> Self {
342-
DEVICE_PERIPHERALS = true;
342+
unsafe { DEVICE_PERIPHERALS = true };
343343

344344
Peripherals {
345345
#exprs

0 commit comments

Comments
 (0)