From 550c492af82d3dd4323e741d624335851adc78fa Mon Sep 17 00:00:00 2001 From: Richard Meadows <962920+richardeoin@users.noreply.github.com> Date: Fri, 29 Nov 2024 21:09:42 +0100 Subject: [PATCH 1/2] In examples, allow the static_mut_refs lint For the future, need to investigate: * How to implement DMA without requiring the lifetime of the buffer to be 'static * How to specific the link_section of non-static buffers --- examples/dma.rs | 1 + examples/ethernet-nucleo-h743zi2.rs | 1 + examples/ethernet-rtic-nucleo-h723zg.rs | 1 + examples/ethernet-rtic-stm32h735g-dk.rs | 1 + examples/ethernet-rtic-stm32h747i-disco.rs | 1 + examples/ethernet-stm32h747i-disco.rs | 1 + examples/i2c4_bdma.rs | 1 + examples/mdma.rs | 1 + examples/mdma_bursts.rs | 1 + examples/sai_dma_passthru.rs | 1 + examples/serial-dma.rs | 1 + examples/spi-dma-rtic.rs | 1 + examples/spi-dma.rs | 1 + examples/usb_passthrough.rs | 1 + examples/usb_phy_serial_interrupt.rs | 1 + examples/usb_rtic.rs | 1 + examples/usb_serial.rs | 1 + 17 files changed, 17 insertions(+) diff --git a/examples/dma.rs b/examples/dma.rs index c1ec1762..e0463819 100644 --- a/examples/dma.rs +++ b/examples/dma.rs @@ -1,6 +1,7 @@ //! Example of Memory to Memory Transfer with the DMA #![deny(warnings)] +#![allow(static_mut_refs)] #![no_main] #![no_std] diff --git a/examples/ethernet-nucleo-h743zi2.rs b/examples/ethernet-nucleo-h743zi2.rs index 917f56d8..e9c3408a 100644 --- a/examples/ethernet-nucleo-h743zi2.rs +++ b/examples/ethernet-nucleo-h743zi2.rs @@ -9,6 +9,7 @@ //! This demo does not use smoltcp - see the ethernet-rtic-stm32h747i-disco demo //! for an example of smoltcp #![deny(warnings)] +#![allow(static_mut_refs)] #![no_main] #![no_std] diff --git a/examples/ethernet-rtic-nucleo-h723zg.rs b/examples/ethernet-rtic-nucleo-h723zg.rs index b155bec7..ac00f672 100644 --- a/examples/ethernet-rtic-nucleo-h723zg.rs +++ b/examples/ethernet-rtic-nucleo-h723zg.rs @@ -12,6 +12,7 @@ //! //! `cargo flash --example ethernet-rtic-nucleo-h723zg --features=ethernet,stm32h735 --chip=STM32H723ZGTx` #![deny(warnings)] +#![allow(static_mut_refs)] #![no_main] #![no_std] diff --git a/examples/ethernet-rtic-stm32h735g-dk.rs b/examples/ethernet-rtic-stm32h735g-dk.rs index 9cedf52b..ae11cdcb 100644 --- a/examples/ethernet-rtic-stm32h735g-dk.rs +++ b/examples/ethernet-rtic-stm32h735g-dk.rs @@ -8,6 +8,7 @@ //! The ethernet ring buffers are placed in AXI SRAM, where they can be //! accessed by both the core and the Ethernet DMA. #![deny(warnings)] +#![allow(static_mut_refs)] #![no_main] #![no_std] diff --git a/examples/ethernet-rtic-stm32h747i-disco.rs b/examples/ethernet-rtic-stm32h747i-disco.rs index 682fa111..1ee4d28f 100644 --- a/examples/ethernet-rtic-stm32h747i-disco.rs +++ b/examples/ethernet-rtic-stm32h747i-disco.rs @@ -15,6 +15,7 @@ //! The ethernet ring buffers are placed in SRAM3, where they can be //! accessed by both the core and the Ethernet DMA. #![deny(warnings)] +#![allow(static_mut_refs)] #![no_main] #![no_std] diff --git a/examples/ethernet-stm32h747i-disco.rs b/examples/ethernet-stm32h747i-disco.rs index e4c1a199..95fef117 100644 --- a/examples/ethernet-stm32h747i-disco.rs +++ b/examples/ethernet-stm32h747i-disco.rs @@ -8,6 +8,7 @@ //! This demo does not use smoltcp - see the ethernet-rtic-stm32h747i-disco demo //! for an example of smoltcp #![deny(warnings)] +#![allow(static_mut_refs)] #![no_main] #![no_std] diff --git a/examples/i2c4_bdma.rs b/examples/i2c4_bdma.rs index e6402567..27b3dfa5 100644 --- a/examples/i2c4_bdma.rs +++ b/examples/i2c4_bdma.rs @@ -3,6 +3,7 @@ //! #![deny(warnings)] +#![allow(static_mut_refs)] #![no_std] #![no_main] diff --git a/examples/mdma.rs b/examples/mdma.rs index 1b3451af..9dd9fc90 100644 --- a/examples/mdma.rs +++ b/examples/mdma.rs @@ -1,6 +1,7 @@ //! Example of Memory to Memory Transfer with the Master DMA (MDMA) #![deny(warnings)] +#![allow(static_mut_refs)] #![no_main] #![no_std] diff --git a/examples/mdma_bursts.rs b/examples/mdma_bursts.rs index bfcd6083..a8c21796 100644 --- a/examples/mdma_bursts.rs +++ b/examples/mdma_bursts.rs @@ -6,6 +6,7 @@ //! beats/burst. The latter gives an approximately 25% speedup. #![deny(warnings)] +#![allow(static_mut_refs)] #![no_main] #![no_std] diff --git a/examples/sai_dma_passthru.rs b/examples/sai_dma_passthru.rs index ca6c14c9..7012cdb8 100644 --- a/examples/sai_dma_passthru.rs +++ b/examples/sai_dma_passthru.rs @@ -3,6 +3,7 @@ #![allow(unused_macros)] #![deny(warnings)] +#![allow(static_mut_refs)] #![no_main] #![no_std] diff --git a/examples/serial-dma.rs b/examples/serial-dma.rs index c61a36e2..38490f72 100644 --- a/examples/serial-dma.rs +++ b/examples/serial-dma.rs @@ -8,6 +8,7 @@ //! the transfer. #![deny(warnings)] +#![allow(static_mut_refs)] #![no_main] #![no_std] diff --git a/examples/spi-dma-rtic.rs b/examples/spi-dma-rtic.rs index bd78229c..94198285 100644 --- a/examples/spi-dma-rtic.rs +++ b/examples/spi-dma-rtic.rs @@ -3,6 +3,7 @@ //! //! This example demonstrates using DMA to write data over a TX-only SPI interface. #![deny(warnings)] +#![allow(static_mut_refs)] #![allow(clippy::type_complexity)] #![no_main] #![no_std] diff --git a/examples/spi-dma.rs b/examples/spi-dma.rs index b3a59a2e..ccf01667 100644 --- a/examples/spi-dma.rs +++ b/examples/spi-dma.rs @@ -8,6 +8,7 @@ //! the transfer. #![deny(warnings)] +#![allow(static_mut_refs)] #![no_main] #![no_std] diff --git a/examples/usb_passthrough.rs b/examples/usb_passthrough.rs index f7f68f80..83ee7d49 100644 --- a/examples/usb_passthrough.rs +++ b/examples/usb_passthrough.rs @@ -5,6 +5,7 @@ //! This example uses both USB1 and USB2. This is only possible on devices that //! have the USB2 peripheral. #![deny(warnings)] +#![allow(static_mut_refs)] #![no_std] #![no_main] diff --git a/examples/usb_phy_serial_interrupt.rs b/examples/usb_phy_serial_interrupt.rs index 90b2533a..f37b7ca8 100644 --- a/examples/usb_phy_serial_interrupt.rs +++ b/examples/usb_phy_serial_interrupt.rs @@ -3,6 +3,7 @@ //! This example is for RM0433/RM0399 parts. It has been tested on the Arduino //! Portenta H7 #![deny(warnings)] +#![allow(static_mut_refs)] #![allow(clippy::type_complexity)] #![no_std] #![no_main] diff --git a/examples/usb_rtic.rs b/examples/usb_rtic.rs index 418bb8b6..db48d917 100644 --- a/examples/usb_rtic.rs +++ b/examples/usb_rtic.rs @@ -7,6 +7,7 @@ //! NUCLEO-H743ZI2 board. //! #![deny(warnings)] +#![allow(static_mut_refs)] #![no_std] #![no_main] diff --git a/examples/usb_serial.rs b/examples/usb_serial.rs index ed9100b4..2499495e 100644 --- a/examples/usb_serial.rs +++ b/examples/usb_serial.rs @@ -9,6 +9,7 @@ //! NUCLEO-H743ZI2 board. //! #![deny(warnings)] +#![allow(static_mut_refs)] #![no_std] #![no_main] From b1684170db0e88d78b8e2ee368a4d71d0105481a Mon Sep 17 00:00:00 2001 From: Richard Meadows <962920+richardeoin@users.noreply.github.com> Date: Fri, 29 Nov 2024 21:29:12 +0100 Subject: [PATCH 2/2] Bump clippy version for CI --- .github/workflows/clippy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 0dd9cc7d..dc870716 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master with: - toolchain: 1.74.0 + toolchain: 1.80.0 target: thumbv7em-none-eabihf components: clippy - uses: clechasseur/rs-clippy-check@v3