aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-futures/src/yield_now.rs1
-rw-r--r--embassy-nrf/src/gpiote.rs1
-rw-r--r--embassy-rp/src/dma.rs1
-rw-r--r--embassy-rp/src/gpio.rs1
-rw-r--r--embassy-rp/src/pio.rs3
-rw-r--r--embassy-stm32/src/dma/mod.rs1
-rw-r--r--embassy-stm32/src/exti.rs1
-rw-r--r--embassy-sync/src/channel.rs4
-rw-r--r--embassy-sync/src/pipe.rs2
-rw-r--r--embassy-time/src/timer.rs1
10 files changed, 16 insertions, 0 deletions
diff --git a/embassy-futures/src/yield_now.rs b/embassy-futures/src/yield_now.rs
index 13b103778..bb3c67d17 100644
--- a/embassy-futures/src/yield_now.rs
+++ b/embassy-futures/src/yield_now.rs
@@ -24,6 +24,7 @@ pub fn yield_now() -> impl Future<Output = ()> {
24 YieldNowFuture { yielded: false } 24 YieldNowFuture { yielded: false }
25} 25}
26 26
27#[must_use = "futures do nothing unless you `.await` or poll them"]
27struct YieldNowFuture { 28struct YieldNowFuture {
28 yielded: bool, 29 yielded: bool,
29} 30}
diff --git a/embassy-nrf/src/gpiote.rs b/embassy-nrf/src/gpiote.rs
index e1816eb9b..66c682b43 100644
--- a/embassy-nrf/src/gpiote.rs
+++ b/embassy-nrf/src/gpiote.rs
@@ -315,6 +315,7 @@ impl<'d, C: Channel, T: GpioPin> OutputChannel<'d, C, T> {
315 315
316// ======================= 316// =======================
317 317
318#[must_use = "futures do nothing unless you `.await` or poll them"]
318pub(crate) struct PortInputFuture<'a> { 319pub(crate) struct PortInputFuture<'a> {
319 pin: PeripheralRef<'a, AnyPin>, 320 pin: PeripheralRef<'a, AnyPin>,
320} 321}
diff --git a/embassy-rp/src/dma.rs b/embassy-rp/src/dma.rs
index fd281fd5d..05adcecdd 100644
--- a/embassy-rp/src/dma.rs
+++ b/embassy-rp/src/dma.rs
@@ -151,6 +151,7 @@ fn copy_inner<'a, C: Channel>(
151 Transfer::new(ch) 151 Transfer::new(ch)
152} 152}
153 153
154#[must_use = "futures do nothing unless you `.await` or poll them"]
154pub struct Transfer<'a, C: Channel> { 155pub struct Transfer<'a, C: Channel> {
155 channel: PeripheralRef<'a, C>, 156 channel: PeripheralRef<'a, C>,
156} 157}
diff --git a/embassy-rp/src/gpio.rs b/embassy-rp/src/gpio.rs
index 76d4281ff..fd3b05567 100644
--- a/embassy-rp/src/gpio.rs
+++ b/embassy-rp/src/gpio.rs
@@ -193,6 +193,7 @@ unsafe fn IO_IRQ_BANK0() {
193 } 193 }
194} 194}
195 195
196#[must_use = "futures do nothing unless you `.await` or poll them"]
196struct InputFuture<'a, T: Pin> { 197struct InputFuture<'a, T: Pin> {
197 pin: PeripheralRef<'a, T>, 198 pin: PeripheralRef<'a, T>,
198 level: InterruptTrigger, 199 level: InterruptTrigger,
diff --git a/embassy-rp/src/pio.rs b/embassy-rp/src/pio.rs
index 2fb2783de..3c7abea25 100644
--- a/embassy-rp/src/pio.rs
+++ b/embassy-rp/src/pio.rs
@@ -120,6 +120,7 @@ unsafe fn PIO1_IRQ_0() {
120} 120}
121 121
122/// Future that waits for TX-FIFO to become writable 122/// Future that waits for TX-FIFO to become writable
123#[must_use = "futures do nothing unless you `.await` or poll them"]
123pub struct FifoOutFuture<'a, PIO: PioInstance, SM: PioStateMachine + Unpin> { 124pub struct FifoOutFuture<'a, PIO: PioInstance, SM: PioStateMachine + Unpin> {
124 sm: &'a mut SM, 125 sm: &'a mut SM,
125 pio: PhantomData<PIO>, 126 pio: PhantomData<PIO>,
@@ -182,6 +183,7 @@ impl<'d, PIO: PioInstance, SM: PioStateMachine + Unpin> Drop for FifoOutFuture<'
182} 183}
183 184
184/// Future that waits for RX-FIFO to become readable 185/// Future that waits for RX-FIFO to become readable
186#[must_use = "futures do nothing unless you `.await` or poll them"]
185pub struct FifoInFuture<'a, PIO: PioInstance, SM: PioStateMachine> { 187pub struct FifoInFuture<'a, PIO: PioInstance, SM: PioStateMachine> {
186 sm: &'a mut SM, 188 sm: &'a mut SM,
187 pio: PhantomData<PIO>, 189 pio: PhantomData<PIO>,
@@ -241,6 +243,7 @@ impl<'d, PIO: PioInstance, SM: PioStateMachine> Drop for FifoInFuture<'d, PIO, S
241} 243}
242 244
243/// Future that waits for IRQ 245/// Future that waits for IRQ
246#[must_use = "futures do nothing unless you `.await` or poll them"]
244pub struct IrqFuture<PIO: PioInstance> { 247pub struct IrqFuture<PIO: PioInstance> {
245 pio: PhantomData<PIO>, 248 pio: PhantomData<PIO>,
246 irq_no: u8, 249 irq_no: u8,
diff --git a/embassy-stm32/src/dma/mod.rs b/embassy-stm32/src/dma/mod.rs
index f5a82fb7a..0030bd575 100644
--- a/embassy-stm32/src/dma/mod.rs
+++ b/embassy-stm32/src/dma/mod.rs
@@ -273,6 +273,7 @@ mod transfers {
273 Transfer::new(channel) 273 Transfer::new(channel)
274 } 274 }
275 275
276 #[must_use = "futures do nothing unless you `.await` or poll them"]
276 pub(crate) struct Transfer<'a, C: Channel> { 277 pub(crate) struct Transfer<'a, C: Channel> {
277 channel: PeripheralRef<'a, C>, 278 channel: PeripheralRef<'a, C>,
278 } 279 }
diff --git a/embassy-stm32/src/exti.rs b/embassy-stm32/src/exti.rs
index c9c3ef62a..e1ce09a49 100644
--- a/embassy-stm32/src/exti.rs
+++ b/embassy-stm32/src/exti.rs
@@ -198,6 +198,7 @@ mod eha {
198 } 198 }
199} 199}
200 200
201#[must_use = "futures do nothing unless you `.await` or poll them"]
201struct ExtiInputFuture<'a> { 202struct ExtiInputFuture<'a> {
202 pin: u8, 203 pin: u8,
203 phantom: PhantomData<&'a mut AnyPin>, 204 phantom: PhantomData<&'a mut AnyPin>,
diff --git a/embassy-sync/src/channel.rs b/embassy-sync/src/channel.rs
index 76f42d0e7..77352874d 100644
--- a/embassy-sync/src/channel.rs
+++ b/embassy-sync/src/channel.rs
@@ -181,6 +181,7 @@ where
181} 181}
182 182
183/// Future returned by [`Channel::recv`] and [`Receiver::recv`]. 183/// Future returned by [`Channel::recv`] and [`Receiver::recv`].
184#[must_use = "futures do nothing unless you `.await` or poll them"]
184pub struct RecvFuture<'ch, M, T, const N: usize> 185pub struct RecvFuture<'ch, M, T, const N: usize>
185where 186where
186 M: RawMutex, 187 M: RawMutex,
@@ -203,6 +204,7 @@ where
203} 204}
204 205
205/// Future returned by [`DynamicReceiver::recv`]. 206/// Future returned by [`DynamicReceiver::recv`].
207#[must_use = "futures do nothing unless you `.await` or poll them"]
206pub struct DynamicRecvFuture<'ch, T> { 208pub struct DynamicRecvFuture<'ch, T> {
207 channel: &'ch dyn DynamicChannel<T>, 209 channel: &'ch dyn DynamicChannel<T>,
208} 210}
@@ -219,6 +221,7 @@ impl<'ch, T> Future for DynamicRecvFuture<'ch, T> {
219} 221}
220 222
221/// Future returned by [`Channel::send`] and [`Sender::send`]. 223/// Future returned by [`Channel::send`] and [`Sender::send`].
224#[must_use = "futures do nothing unless you `.await` or poll them"]
222pub struct SendFuture<'ch, M, T, const N: usize> 225pub struct SendFuture<'ch, M, T, const N: usize>
223where 226where
224 M: RawMutex, 227 M: RawMutex,
@@ -250,6 +253,7 @@ where
250impl<'ch, M, T, const N: usize> Unpin for SendFuture<'ch, M, T, N> where M: RawMutex {} 253impl<'ch, M, T, const N: usize> Unpin for SendFuture<'ch, M, T, N> where M: RawMutex {}
251 254
252/// Future returned by [`DynamicSender::send`]. 255/// Future returned by [`DynamicSender::send`].
256#[must_use = "futures do nothing unless you `.await` or poll them"]
253pub struct DynamicSendFuture<'ch, T> { 257pub struct DynamicSendFuture<'ch, T> {
254 channel: &'ch dyn DynamicChannel<T>, 258 channel: &'ch dyn DynamicChannel<T>,
255 message: Option<T>, 259 message: Option<T>,
diff --git a/embassy-sync/src/pipe.rs b/embassy-sync/src/pipe.rs
index 905686acd..1977005fb 100644
--- a/embassy-sync/src/pipe.rs
+++ b/embassy-sync/src/pipe.rs
@@ -48,6 +48,7 @@ where
48} 48}
49 49
50/// Future returned by [`Pipe::write`] and [`Writer::write`]. 50/// Future returned by [`Pipe::write`] and [`Writer::write`].
51#[must_use = "futures do nothing unless you `.await` or poll them"]
51pub struct WriteFuture<'p, M, const N: usize> 52pub struct WriteFuture<'p, M, const N: usize>
52where 53where
53 M: RawMutex, 54 M: RawMutex,
@@ -110,6 +111,7 @@ where
110} 111}
111 112
112/// Future returned by [`Pipe::read`] and [`Reader::read`]. 113/// Future returned by [`Pipe::read`] and [`Reader::read`].
114#[must_use = "futures do nothing unless you `.await` or poll them"]
113pub struct ReadFuture<'p, M, const N: usize> 115pub struct ReadFuture<'p, M, const N: usize>
114where 116where
115 M: RawMutex, 117 M: RawMutex,
diff --git a/embassy-time/src/timer.rs b/embassy-time/src/timer.rs
index bd791b817..f74b5cb24 100644
--- a/embassy-time/src/timer.rs
+++ b/embassy-time/src/timer.rs
@@ -26,6 +26,7 @@ pub async fn with_timeout<F: Future>(timeout: Duration, fut: F) -> Result<F::Out
26} 26}
27 27
28/// A future that completes at a specified [Instant](struct.Instant.html). 28/// A future that completes at a specified [Instant](struct.Instant.html).
29#[must_use = "futures do nothing unless you `.await` or poll them"]
29pub struct Timer { 30pub struct Timer {
30 expires_at: Instant, 31 expires_at: Instant,
31 yielded_once: bool, 32 yielded_once: bool,