Skip to content

Commit cfaf229

Browse files
committed
use core::ptr::from_ref
1 parent f0f71e9 commit cfaf229

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
- { rust: stable, vendor: Toshiba, options: all }
8585
- { rust: stable, vendor: Toshiba, options: "" }
8686
# Test MSRV
87-
- { rust: 1.74.0, vendor: Nordic, options: "" }
87+
- { rust: 1.76.0, vendor: Nordic, options: "" }
8888
# Use nightly for architectures which don't support stable
8989
- { rust: nightly, vendor: MSP430, options: "--atomics" }
9090
- { rust: nightly, vendor: MSP430, options: "" }

CHANGELOG.md

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

88
## [Unreleased]
99

10+
- Bump MSRV of generated code to 1.76
11+
1012
## [v0.33.3] - 2024-05-10
1113

1214
- Yet more clean field & register `Debug`

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ This project is developed and maintained by the [Tools team][team].
1717

1818
## Minimum Supported Rust Version (MSRV)
1919

20-
The **generated code** is guaranteed to compile on stable Rust 1.65.0 and up.
20+
The **generated code** is guaranteed to compile on stable Rust 1.76.0 and up.
2121

22-
If you encounter compilation errors on any stable version newer than 1.65.0, please open an issue.
22+
If you encounter compilation errors on any stable version newer than 1.76.0, please open an issue.
2323

2424
# Testing Locally
2525

src/generate/peripheral/accessor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl ToTokens for RawRegAccessor {
118118
#[doc = #doc]
119119
#[inline(always)]
120120
pub const fn #name(&self) -> &#ty {
121-
unsafe { &*(self as *const Self).cast::<u8>().add(#offset).cast() }
121+
unsafe { &*core::ptr::from_ref(self).cast::<u8>().add(#offset).cast() }
122122
}
123123
}
124124
.to_tokens(tokens);
@@ -177,7 +177,7 @@ impl ToTokens for RawArrayAccessor {
177177
increment,
178178
} = self;
179179
let name_iter = Ident::new(&format!("{name}_iter"), Span::call_site());
180-
let cast = quote! { unsafe { &*(self as *const Self).cast::<u8>().add(#offset).add(#increment * n).cast() } };
180+
let cast = quote! { unsafe { &*core::ptr::from_ref(self).cast::<u8>().add(#offset).add(#increment * n).cast() } };
181181
quote! {
182182
#[doc = #doc]
183183
#[inline(always)]

0 commit comments

Comments
 (0)