diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bfde64b9..1bd9652e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,7 +83,11 @@ 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 @@ -92,8 +96,16 @@ jobs: - { 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 @@ -107,7 +119,7 @@ jobs: - name: Self install run: | - cargo install svd2rust --path . + cargo install svd2rust --path . --force - name: Run CI script for `${{ matrix.vendor }}` under rust `${{ matrix.rust }}` with options=`${{ matrix.options }}` env: @@ -132,7 +144,7 @@ jobs: - name: Self install run: | - cargo install svd2rust --path . + cargo install svd2rust --path . --force - name: Run CI script env: diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ee8ba46..15ea9b1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] +- Mark peripheral with `non_exhaustive` - Force using rust edition 2021 in CI ## [v0.35.0] - 2024-11-12 diff --git a/src/generate/device.rs b/src/generate/device.rs index d2b3ee9c..24e8fc8b 100644 --- a/src/generate/device.rs +++ b/src/generate/device.rs @@ -64,7 +64,6 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result Result { for p_name in names(p, dim_element) { @@ -288,7 +287,7 @@ pub fn render(d: &Device, config: &Config, device_x: &mut String) -> Result Result /// peripheral instance existing to ensure memory safety; ensure /// no stolen instances are passed to such software. pub unsafe fn steal() -> Self { - Self { _marker: PhantomData } + Self } }; @@ -97,7 +97,8 @@ pub fn render(p_original: &Peripheral, index: &Index, config: &Config) -> Result #phtml #doc_alias #feature_attribute - pub struct #p_ty { _marker: PhantomData<*const ()> } + #[non_exhaustive] + pub struct #p_ty; #feature_attribute unsafe impl Send for #p_ty {}