From 9bd34429f3366dd7ac52f85064af5899bd3296f3 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Wed, 4 Aug 2021 19:39:54 +0200 Subject: [PATCH] stm32: add missing `+ 'a` bounds on trait GATs --- embassy-stm32/src/dma/bdma.rs | 4 ++-- embassy-stm32/src/dma/dma.rs | 4 ++-- embassy-stm32/src/rng.rs | 2 +- embassy-stm32/src/usart/v1.rs | 4 ++-- embassy-stm32/src/usart/v2.rs | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/embassy-stm32/src/dma/bdma.rs b/embassy-stm32/src/dma/bdma.rs index 2aa00ebe..d262caeb 100644 --- a/embassy-stm32/src/dma/bdma.rs +++ b/embassy-stm32/src/dma/bdma.rs @@ -159,8 +159,8 @@ pac::dma_channels! { impl crate::dma::sealed::Channel for crate::peripherals::$channel_peri {} impl Channel for crate::peripherals::$channel_peri { - type ReadFuture<'a> = impl Future; - type WriteFuture<'a> = impl Future; + type ReadFuture<'a> = impl Future + 'a; + type WriteFuture<'a> = impl Future + 'a; fn read<'a>( &'a mut self, diff --git a/embassy-stm32/src/dma/dma.rs b/embassy-stm32/src/dma/dma.rs index 47120c39..9bf083de 100644 --- a/embassy-stm32/src/dma/dma.rs +++ b/embassy-stm32/src/dma/dma.rs @@ -165,8 +165,8 @@ pac::dma_channels! { impl crate::dma::sealed::Channel for crate::peripherals::$channel_peri {} impl Channel for crate::peripherals::$channel_peri { - type ReadFuture<'a> = impl Future; - type WriteFuture<'a> = impl Future; + type ReadFuture<'a> = impl Future + 'a; + type WriteFuture<'a> = impl Future + 'a; fn read<'a>( &'a mut self, diff --git a/embassy-stm32/src/rng.rs b/embassy-stm32/src/rng.rs index d93a25f5..a56fba19 100644 --- a/embassy-stm32/src/rng.rs +++ b/embassy-stm32/src/rng.rs @@ -84,7 +84,7 @@ impl CryptoRng for Random {} impl traits::rng::Rng for Random { type Error = Error; #[rustfmt::skip] - type RngFuture<'a> where Self: 'a = impl Future>; + type RngFuture<'a> where Self: 'a = impl Future> + 'a; fn fill_bytes<'a>(&'a mut self, dest: &'a mut [u8]) -> Self::RngFuture<'a> { unsafe { diff --git a/embassy-stm32/src/usart/v1.rs b/embassy-stm32/src/usart/v1.rs index 9e9b4930..ec667769 100644 --- a/embassy-stm32/src/usart/v1.rs +++ b/embassy-stm32/src/usart/v1.rs @@ -153,7 +153,7 @@ impl<'d, T: Instance, RxDma> embedded_hal::blocking::serial::Write impl<'d, T: Instance, TxDma, RxDma> embassy_traits::uart::Write for Uart<'d, T, TxDma, RxDma> where TxDma: crate::usart::TxDma { - type WriteFuture<'a> where Self: 'a = impl Future>; + type WriteFuture<'a> where Self: 'a = impl Future> + 'a; fn write<'a>(&'a mut self, buf: &'a [u8]) -> Self::WriteFuture<'a> { self.write_dma(buf).map_err(|_| embassy_traits::uart::Error::Other) @@ -165,7 +165,7 @@ impl<'d, T: Instance, TxDma, RxDma> embassy_traits::uart::Write for Uart<'d, T, impl<'d, T: Instance, TxDma, RxDma> embassy_traits::uart::Read for Uart<'d, T, TxDma, RxDma> where RxDma: crate::usart::RxDma { - type ReadFuture<'a> where Self: 'a = impl Future>; + type ReadFuture<'a> where Self: 'a = impl Future> + 'a; fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Self::ReadFuture<'a> { self.read_dma(buf).map_err(|_| embassy_traits::uart::Error::Other) diff --git a/embassy-stm32/src/usart/v2.rs b/embassy-stm32/src/usart/v2.rs index 694b1618..50996dbb 100644 --- a/embassy-stm32/src/usart/v2.rs +++ b/embassy-stm32/src/usart/v2.rs @@ -157,7 +157,7 @@ impl<'d, T: Instance, RxDma> embedded_hal::blocking::serial::Write impl<'d, T: Instance, TxDma, RxDma> embassy_traits::uart::Write for Uart<'d, T, TxDma, RxDma> where TxDma: crate::usart::TxDma { - type WriteFuture<'a> where Self: 'a = impl Future>; + type WriteFuture<'a> where Self: 'a = impl Future> + 'a; fn write<'a>(&'a mut self, buf: &'a [u8]) -> Self::WriteFuture<'a> { self.write_dma(buf).map_err(|_| embassy_traits::uart::Error::Other) @@ -169,7 +169,7 @@ impl<'d, T: Instance, TxDma, RxDma> embassy_traits::uart::Write for Uart<'d, T, impl<'d, T: Instance, TxDma, RxDma> embassy_traits::uart::Read for Uart<'d, T, TxDma, RxDma> where RxDma: crate::usart::RxDma { - type ReadFuture<'a> where Self: 'a = impl Future>; + type ReadFuture<'a> where Self: 'a = impl Future> + 'a; fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Self::ReadFuture<'a> { self.read_dma(buf).map_err(|_| embassy_traits::uart::Error::Other)