Skip to content

Commit

Permalink
Updates for Xtensa enabled 1.83 compiler (#2615)
Browse files Browse the repository at this point in the history
* test ci

* fix ci with new compiler

* god bless clippy fix

* refmuts

* clippy

* tests work

* use new compiler

* use new compiler

* bump MSRV of esp-hal and crates that depend on esp-hal

* fix eyesore

* clippy again

* remove hardcoded compiler version

* bump rust-version as well

* note MSRV bump in changelog
  • Loading branch information
MabezDev authored Dec 17, 2024
1 parent a12e7fe commit 85d30e9
Show file tree
Hide file tree
Showing 39 changed files with 810 additions and 847 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MSRV: "1.79.0"
MSRV: "1.83.0"
RUSTDOCFLAGS: -Dwarnings
DEFMT_LOG: trace

Expand Down
3 changes: 3 additions & 0 deletions esp-hal-embassy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]


### Added

### Changed

- Bump MSRV to 1.83 (#2615)

### Fixed

### Removed
Expand Down
2 changes: 1 addition & 1 deletion esp-hal-embassy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "esp-hal-embassy"
version = "0.5.0"
edition = "2021"
rust-version = "1.79.0"
rust-version = "1.83.0"
description = "Embassy support for esp-hal"
repository = "https://github.com/esp-rs/esp-hal"
license = "MIT OR Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions esp-hal-embassy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Crates.io](https://img.shields.io/crates/v/esp-hal-embassy?labelColor=1C2C2E&color=C96329&logo=Rust&style=flat-square)](https://crates.io/crates/esp-hal-embassy)
[![docs.rs](https://img.shields.io/docsrs/esp-hal-embassy?labelColor=1C2C2E&color=C96329&logo=rust&style=flat-square)](https://docs.rs/esp-hal-embassy)
![MSRV](https://img.shields.io/badge/MSRV-1.76-blue?labelColor=1C2C2E&style=flat-square)
![MSRV](https://img.shields.io/badge/MSRV-1.83-blue?labelColor=1C2C2E&style=flat-square)
![Crates.io](https://img.shields.io/crates/l/esp-hal-embassy?labelColor=1C2C2E&style=flat-square)
[![Matrix](https://img.shields.io/matrix/esp-rs:matrix.org?label=join%20matrix&labelColor=1C2C2E&color=BEC5C9&logo=matrix&style=flat-square)](https://matrix.to/#/#esp-rs:matrix.org)

Expand All @@ -18,7 +18,7 @@ Note that this crate currently requires you to enable the `unstable` feature on

## Minimum Supported Rust Version (MSRV)

This crate is guaranteed to compile on stable Rust 1.79 and up. It _might_
This crate is guaranteed to compile on stable Rust 1.83 and up. It _might_
compile with older versions but that may change in any new patch release.

## License
Expand Down
2 changes: 1 addition & 1 deletion esp-hal-procmacros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "esp-hal-procmacros"
version = "0.15.0"
edition = "2021"
rust-version = "1.76.0"
rust-version = "1.83.0"
description = "Procedural macros for esp-hal"
repository = "https://github.com/esp-rs/esp-hal"
license = "MIT OR Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions esp-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]


### Added

- ESP32-S3: Added SDMMC signals (#2556)
Expand Down Expand Up @@ -35,6 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Bump MSRV to 1.83 (#2615)
- In addition to taking by value, peripheral drivers can now mutably borrow DMA channel objects. (#2526)
- DMA channel objects are no longer wrapped in `Channel`. The `Channel` drivers are now managed by DMA enabled peripheral drivers. (#2526)
- The `Dpi` driver and `DpiTransfer` now have a `Mode` type parameter. The driver's asyncness is determined by the asyncness of the `Lcd` used to create it. (#2526)
Expand Down Expand Up @@ -200,8 +202,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [0.21.0]

- Bump MSRV to 1.79.0 (#1971)

### Added

- Introduce traits for the DMA buffer objects (#1976, #2213)
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "esp-hal"
version = "0.22.0"
edition = "2021"
rust-version = "1.79.0"
rust-version = "1.83.0"
description = "Bare-metal HAL for Espressif devices"
documentation = "https://docs.esp-rs.org/esp-hal/"
repository = "https://github.com/esp-rs/esp-hal"
Expand Down
4 changes: 2 additions & 2 deletions esp-hal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Crates.io](https://img.shields.io/crates/v/esp-hal?labelColor=1C2C2E&color=C96329&logo=Rust&style=flat-square)](https://crates.io/crates/esp-hal)
[![docs.rs](https://img.shields.io/docsrs/esp-hal?labelColor=1C2C2E&color=C96329&logo=rust&style=flat-square)](https://docs.esp-rs.org/esp-hal)
![MSRV](https://img.shields.io/badge/MSRV-1.76-blue?labelColor=1C2C2E&style=flat-square)
![MSRV](https://img.shields.io/badge/MSRV-1.83-blue?labelColor=1C2C2E&style=flat-square)
![Crates.io](https://img.shields.io/crates/l/esp-hal?labelColor=1C2C2E&style=flat-square)
[![Matrix](https://img.shields.io/matrix/esp-rs:matrix.org?label=join%20matrix&labelColor=1C2C2E&color=BEC5C9&logo=matrix&style=flat-square)](https://matrix.to/#/#esp-rs:matrix.org)

Expand Down Expand Up @@ -48,7 +48,7 @@ For help getting started with this HAL, please refer to [The Rust on ESP Book] a

## Minimum Supported Rust Version (MSRV)

This crate is guaranteed to compile on stable Rust 1.79 and up. It _might_
This crate is guaranteed to compile on stable Rust 1.83 and up. It _might_
compile with older versions but that may change in any new patch release.

## License
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/analog/adc/esp32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ where
}
}

impl<'d, ADC1> Adc<'d, ADC1> {
impl<ADC1> Adc<'_, ADC1> {
/// Enable the Hall sensor
pub fn enable_hall_sensor() {
unsafe { &*RTC_IO::ptr() }
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/assist_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ impl DebugAssist<'_> {
}

#[cfg(all(assist_debug_region_monitor, multi_core))]
impl<'d> DebugAssist<'d> {
impl DebugAssist<'_> {
/// Enable region monitoring of read/write performed by the secondary CPU in
/// a certain memory region0. Whenever the bus reads or writes in the
/// specified memory region, an interrupt will be triggered.
Expand Down
4 changes: 2 additions & 2 deletions esp-hal/src/dma/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1892,7 +1892,7 @@ where
}
}

impl<'a, M, CH> ChannelRx<'a, M, CH>
impl<M, CH> ChannelRx<'_, M, CH>
where
M: Mode,
CH: DmaRxChannel,
Expand Down Expand Up @@ -2186,7 +2186,7 @@ where
}
}

impl<'a, M, CH> ChannelTx<'a, M, CH>
impl<M, CH> ChannelTx<'_, M, CH>
where
M: Mode,
CH: DmaTxChannel,
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/dma/pdma/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ pub(super) fn init_dma(_cs: CriticalSection<'_>) {
}
}

impl<'d, CH, M> Channel<'d, M, CH>
impl<CH, M> Channel<'_, M, CH>
where
CH: DmaChannel,
M: Mode,
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/gpio/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2459,7 +2459,7 @@ mod asynch {
pin: Flex<'d, P>,
}

impl<'d, P: InputPin> PinFuture<'d, P> {
impl<P: InputPin> PinFuture<'_, P> {
fn pin_mask(&self) -> u32 {
let bank = self.pin.gpio_bank(private::Internal);
1 << (self.pin.number() - bank.offset())
Expand Down
6 changes: 3 additions & 3 deletions esp-hal/src/i2s/parallel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ where
}
}

impl<'d, I, BUF, DM> Deref for I2sParallelTransfer<'d, BUF, DM, I>
impl<I, BUF, DM> Deref for I2sParallelTransfer<'_, BUF, DM, I>
where
I: Instance,
BUF: DmaTxBuffer,
Expand All @@ -414,7 +414,7 @@ where
}
}

impl<'d, I, BUF, DM> DerefMut for I2sParallelTransfer<'d, BUF, DM, I>
impl<I, BUF, DM> DerefMut for I2sParallelTransfer<'_, BUF, DM, I>
where
I: Instance,
BUF: DmaTxBuffer,
Expand All @@ -425,7 +425,7 @@ where
}
}

impl<'d, I, BUF, DM> Drop for I2sParallelTransfer<'d, BUF, DM, I>
impl<I, BUF, DM> Drop for I2sParallelTransfer<'_, BUF, DM, I>
where
I: Instance,
BUF: DmaTxBuffer,
Expand Down
6 changes: 3 additions & 3 deletions esp-hal/src/lcd_cam/cam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,21 +432,21 @@ impl<'d, BUF: DmaRxBuffer> CameraTransfer<'d, BUF> {
}
}

impl<'d, BUF: DmaRxBuffer> Deref for CameraTransfer<'d, BUF> {
impl<BUF: DmaRxBuffer> Deref for CameraTransfer<'_, BUF> {
type Target = BUF::View;

fn deref(&self) -> &Self::Target {
&self.buffer_view
}
}

impl<'d, BUF: DmaRxBuffer> DerefMut for CameraTransfer<'d, BUF> {
impl<BUF: DmaRxBuffer> DerefMut for CameraTransfer<'_, BUF> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.buffer_view
}
}

impl<'d, BUF: DmaRxBuffer> Drop for CameraTransfer<'d, BUF> {
impl<BUF: DmaRxBuffer> Drop for CameraTransfer<'_, BUF> {
fn drop(&mut self) {
self.stop_peripherals();

Expand Down
6 changes: 3 additions & 3 deletions esp-hal/src/lcd_cam/lcd/dpi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,21 +661,21 @@ impl<'d, BUF: DmaTxBuffer, DM: Mode> DpiTransfer<'d, BUF, DM> {
}
}

impl<'d, BUF: DmaTxBuffer, DM: Mode> Deref for DpiTransfer<'d, BUF, DM> {
impl<BUF: DmaTxBuffer, DM: Mode> Deref for DpiTransfer<'_, BUF, DM> {
type Target = BUF::View;

fn deref(&self) -> &Self::Target {
&self.buffer_view
}
}

impl<'d, BUF: DmaTxBuffer, DM: Mode> DerefMut for DpiTransfer<'d, BUF, DM> {
impl<BUF: DmaTxBuffer, DM: Mode> DerefMut for DpiTransfer<'_, BUF, DM> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.buffer_view
}
}

impl<'d, BUF: DmaTxBuffer, DM: Mode> Drop for DpiTransfer<'d, BUF, DM> {
impl<BUF: DmaTxBuffer, DM: Mode> Drop for DpiTransfer<'_, BUF, DM> {
fn drop(&mut self) {
self.stop_peripherals();

Expand Down
12 changes: 6 additions & 6 deletions esp-hal/src/lcd_cam/lcd/i8080.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ where
}
}

impl<'d, DM: Mode> core::fmt::Debug for I8080<'d, DM> {
impl<DM: Mode> core::fmt::Debug for I8080<'_, DM> {
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
f.debug_struct("I8080").finish()
}
Expand Down Expand Up @@ -470,15 +470,15 @@ impl<'d, BUF: DmaTxBuffer, DM: Mode> I8080Transfer<'d, BUF, DM> {
}
}

impl<'d, BUF: DmaTxBuffer, DM: Mode> Deref for I8080Transfer<'d, BUF, DM> {
impl<BUF: DmaTxBuffer, DM: Mode> Deref for I8080Transfer<'_, BUF, DM> {
type Target = BUF::View;

fn deref(&self) -> &Self::Target {
&self.buf_view
}
}

impl<'d, BUF: DmaTxBuffer, DM: Mode> DerefMut for I8080Transfer<'d, BUF, DM> {
impl<BUF: DmaTxBuffer, DM: Mode> DerefMut for I8080Transfer<'_, BUF, DM> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.buf_view
}
Expand Down Expand Up @@ -523,7 +523,7 @@ impl<'d, BUF: DmaTxBuffer> I8080Transfer<'d, BUF, crate::Async> {
}
}

impl<'d, BUF: DmaTxBuffer, DM: Mode> Drop for I8080Transfer<'d, BUF, DM> {
impl<BUF: DmaTxBuffer, DM: Mode> Drop for I8080Transfer<'_, BUF, DM> {
fn drop(&mut self) {
self.stop_peripherals();

Expand Down Expand Up @@ -645,7 +645,7 @@ impl<'d> TxEightBits<'d> {
}
}

impl<'d> TxPins for TxEightBits<'d> {
impl TxPins for TxEightBits<'_> {
fn configure(&mut self) {
const SIGNALS: [OutputSignal; 8] = [
OutputSignal::LCD_DATA_0,
Expand Down Expand Up @@ -706,7 +706,7 @@ impl<'d> TxSixteenBits<'d> {
}
}

impl<'d> TxPins for TxSixteenBits<'d> {
impl TxPins for TxSixteenBits<'_> {
fn configure(&mut self) {
const SIGNALS: [OutputSignal; 16] = [
OutputSignal::LCD_DATA_0,
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/ledc/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ impl TimerHW<LowSpeed> for Timer<'_, LowSpeed> {

#[cfg(esp32)]
/// Timer HW implementation for HighSpeed timers
impl<'a> TimerHW<HighSpeed> for Timer<'a, HighSpeed> {
impl TimerHW<HighSpeed> for Timer<'_, HighSpeed> {
/// Get the current source timer frequency from the HW
fn freq_hw(&self) -> Option<HertzU32> {
self.clock_source.map(|source| match source {
Expand Down
8 changes: 4 additions & 4 deletions esp-hal/src/otg_fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ impl<'d> Usb<'d> {
}
}

unsafe impl<'d> Sync for Usb<'d> {}
unsafe impl Sync for Usb<'_> {}

unsafe impl<'d> UsbPeripheral for Usb<'d> {
unsafe impl UsbPeripheral for Usb<'_> {
const REGISTERS: *const () = peripherals::USB0::ptr() as *const ();

const HIGH_SPEED: bool = false;
Expand Down Expand Up @@ -250,7 +250,7 @@ pub mod asynch {
_usb: Usb<'d>,
}

impl<'d> Bus<'d> {
impl Bus<'_> {
fn init(&mut self) {
Usb::_enable();

Expand Down Expand Up @@ -328,7 +328,7 @@ pub mod asynch {
}
}

impl<'d> Drop for Bus<'d> {
impl Drop for Bus<'_> {
fn drop(&mut self) {
Bus::disable(self);
}
Expand Down
8 changes: 4 additions & 4 deletions esp-hal/src/rsa/esp32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::rsa::{
RsaMultiplication,
};

impl<'d, DM: crate::Mode> Rsa<'d, DM> {
impl<DM: crate::Mode> Rsa<'_, DM> {
/// After the RSA Accelerator is released from reset, the memory blocks
/// needs to be initialized, only after that peripheral should be used.
/// This function would return without an error if the memory is initialized
Expand Down Expand Up @@ -79,7 +79,7 @@ pub mod operand_sizes {
);
}

impl<'a, 'd, T: RsaMode, DM: crate::Mode, const N: usize> RsaModularMultiplication<'a, 'd, T, DM>
impl<'d, T: RsaMode, DM: crate::Mode, const N: usize> RsaModularMultiplication<'_, 'd, T, DM>
where
T: RsaMode<InputType = [u32; N]>,
{
Expand All @@ -98,7 +98,7 @@ where
}
}

impl<'a, 'd, T: RsaMode, DM: crate::Mode, const N: usize> RsaModularExponentiation<'a, 'd, T, DM>
impl<'d, T: RsaMode, DM: crate::Mode, const N: usize> RsaModularExponentiation<'_, 'd, T, DM>
where
T: RsaMode<InputType = [u32; N]>,
{
Expand All @@ -108,7 +108,7 @@ where
}
}

impl<'a, 'd, T: RsaMode + Multi, DM: crate::Mode, const N: usize> RsaMultiplication<'a, 'd, T, DM>
impl<'d, T: RsaMode + Multi, DM: crate::Mode, const N: usize> RsaMultiplication<'_, 'd, T, DM>
where
T: RsaMode<InputType = [u32; N]>,
{
Expand Down
Loading

0 comments on commit 85d30e9

Please sign in to comment.