From 7be385dbb182a2bdafa286e4eb214bfea0190342 Mon Sep 17 00:00:00 2001 From: Rasmus Melchior Jacobsen Date: Fri, 17 Mar 2023 11:40:19 +0100 Subject: [PATCH] Add must_use to OnDrop --- embassy-hal-common/src/drop.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/embassy-hal-common/src/drop.rs b/embassy-hal-common/src/drop.rs index 6ef716f99..7cd16aaec 100644 --- a/embassy-hal-common/src/drop.rs +++ b/embassy-hal-common/src/drop.rs @@ -1,6 +1,7 @@ use core::mem; use core::mem::MaybeUninit; +#[must_use = "to delay the drop handler invokation to the end of the scope"] pub struct OnDrop { f: MaybeUninit, } @@ -27,6 +28,7 @@ impl Drop for OnDrop { /// /// To correctly dispose of this device, call the [defuse](struct.DropBomb.html#method.defuse) /// method before this object is dropped. +#[must_use = "to delay the drop bomb invokation to the end of the scope"] pub struct DropBomb { _private: (), }