From ed35243644ba185a1249a28c958718cb087d78d0 Mon Sep 17 00:00:00 2001 From: Andrey Zgarbul Date: Wed, 11 Dec 2024 23:34:03 +0300 Subject: [PATCH] unsafe no-mangle --- .github/workflows/ci.yml | 20 ++++++++++++++++---- CHANGELOG.md | 2 ++ README.md | 4 ++-- src/generate/device.rs | 8 +++++--- src/generate/interrupt.rs | 10 +++++----- 5 files changed, 30 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bfde64b9..97ac1e76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,17 +83,29 @@ jobs: - { rust: stable, vendor: Spansion, options: "--atomics" } - { rust: stable, vendor: STMicro, options: "" } - { rust: stable, vendor: STMicro, options: "--atomics" } - - { rust: stable, vendor: STM32-patched, options: "--strict -f enum_value::p: --max-cluster-size --atomics --atomics-feature atomics --impl-debug --impl-defmt defmt" } + - { + rust: stable, + vendor: STM32-patched, + options: "--strict -f enum_value::p: --max-cluster-size --atomics --atomics-feature atomics --impl-debug --impl-defmt defmt", + } - { rust: stable, vendor: Toshiba, options: all } - { rust: stable, vendor: Toshiba, options: "" } # Test MSRV - - { rust: 1.76.0, vendor: Nordic, options: "" } + - { rust: 1.82.0, vendor: Nordic, options: "" } # Use nightly for architectures which don't support stable - { rust: nightly, vendor: MSP430, options: "--atomics" } - { rust: nightly, vendor: MSP430, options: "" } # Workaround for _1token0 - - { rust: nightly-2024-09-25, vendor: Espressif, options: "--atomics --ident-formats-theme legacy" } - - { rust: nightly-2024-09-25, vendor: Espressif, options: "--ident-format register:::Reg" } + - { + rust: nightly-2024-09-25, + vendor: Espressif, + options: "--atomics --ident-formats-theme legacy", + } + - { + rust: nightly-2024-09-25, + vendor: Espressif, + options: "--ident-format register:::Reg", + } steps: - uses: actions/checkout@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 1eb5bc5c..1096dcbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Bump MSRV of generated code to 1.82 + ## [v0.35.0] - 2024-11-12 - Add `crate_path` setting diff --git a/README.md b/README.md index d0bf6fb5..25203809 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,9 @@ This project is developed and maintained by the [Tools team][team]. ## Minimum Supported Rust Version (MSRV) -The **generated code** is guaranteed to compile on stable Rust 1.76.0 and up. +The **generated code** is guaranteed to compile on stable Rust 1.82.0 and up. -If you encounter compilation errors on any stable version newer than 1.76.0, please open an issue. +If you encounter compilation errors on any stable version newer than 1.82.0, please open an issue. # Testing Locally diff --git a/src/generate/device.rs b/src/generate/device.rs index d2b3ee9c..bd837a7e 100644 --- a/src/generate/device.rs +++ b/src/generate/device.rs @@ -273,7 +273,7 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result { for p_name in names(p, dim_element) { @@ -288,7 +288,9 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result Result { #[allow(non_snake_case)] - #[no_mangle] + #[unsafe(no_mangle)] pub extern #abi fn $NAME() { // check that the handler exists let _ = $crate::interrupt::Interrupt::$NAME;