stm32: add missing + 'a bounds on trait GATs

This commit is contained in:
Dario Nieuwenhuis 2021-08-04 19:39:54 +02:00
parent 250f1cd0a5
commit 9bd34429f3
5 changed files with 9 additions and 9 deletions

View file

@ -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<Output = ()>;
type WriteFuture<'a> = impl Future<Output = ()>;
type ReadFuture<'a> = impl Future<Output = ()> + 'a;
type WriteFuture<'a> = impl Future<Output = ()> + 'a;
fn read<'a>(
&'a mut self,

View file

@ -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<Output = ()>;
type WriteFuture<'a> = impl Future<Output = ()>;
type ReadFuture<'a> = impl Future<Output = ()> + 'a;
type WriteFuture<'a> = impl Future<Output = ()> + 'a;
fn read<'a>(
&'a mut self,

View file

@ -84,7 +84,7 @@ impl<T: Instance> CryptoRng for Random<T> {}
impl<T: Instance> traits::rng::Rng for Random<T> {
type Error = Error;
#[rustfmt::skip]
type RngFuture<'a> where Self: 'a = impl Future<Output=Result<(), Self::Error>>;
type RngFuture<'a> where Self: 'a = impl Future<Output=Result<(), Self::Error>> + 'a;
fn fill_bytes<'a>(&'a mut self, dest: &'a mut [u8]) -> Self::RngFuture<'a> {
unsafe {

View file

@ -153,7 +153,7 @@ impl<'d, T: Instance, RxDma> embedded_hal::blocking::serial::Write<u8>
impl<'d, T: Instance, TxDma, RxDma> embassy_traits::uart::Write for Uart<'d, T, TxDma, RxDma>
where TxDma: crate::usart::TxDma<T>
{
type WriteFuture<'a> where Self: 'a = impl Future<Output = Result<(), embassy_traits::uart::Error>>;
type WriteFuture<'a> where Self: 'a = impl Future<Output = Result<(), embassy_traits::uart::Error>> + '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<T>
{
type ReadFuture<'a> where Self: 'a = impl Future<Output = Result<(), embassy_traits::uart::Error>>;
type ReadFuture<'a> where Self: 'a = impl Future<Output = Result<(), embassy_traits::uart::Error>> + '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)

View file

@ -157,7 +157,7 @@ impl<'d, T: Instance, RxDma> embedded_hal::blocking::serial::Write<u8>
impl<'d, T: Instance, TxDma, RxDma> embassy_traits::uart::Write for Uart<'d, T, TxDma, RxDma>
where TxDma: crate::usart::TxDma<T>
{
type WriteFuture<'a> where Self: 'a = impl Future<Output = Result<(), embassy_traits::uart::Error>>;
type WriteFuture<'a> where Self: 'a = impl Future<Output = Result<(), embassy_traits::uart::Error>> + '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<T>
{
type ReadFuture<'a> where Self: 'a = impl Future<Output = Result<(), embassy_traits::uart::Error>>;
type ReadFuture<'a> where Self: 'a = impl Future<Output = Result<(), embassy_traits::uart::Error>> + '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)