From cf2bcd10ed28b169b8df74383c2a35a4ffbdcf40 Mon Sep 17 00:00:00 2001 From: John Kugelman Date: Sun, 10 Oct 2021 18:22:40 -0400 Subject: Add #[must_use] to from_value conversions --- library/core/src/task/wake.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'library/core/src/task') diff --git a/library/core/src/task/wake.rs b/library/core/src/task/wake.rs index b775e022a54..e1bbdfaef80 100644 --- a/library/core/src/task/wake.rs +++ b/library/core/src/task/wake.rs @@ -158,6 +158,7 @@ pub struct Context<'a> { impl<'a> Context<'a> { /// Create a new `Context` from a `&Waker`. #[stable(feature = "futures_api", since = "1.36.0")] + #[must_use] #[inline] pub fn from_waker(waker: &'a Waker) -> Self { Context { waker, _marker: PhantomData } @@ -251,6 +252,7 @@ impl Waker { /// in [`RawWaker`]'s and [`RawWakerVTable`]'s documentation is not upheld. /// Therefore this method is unsafe. #[inline] + #[must_use] #[stable(feature = "futures_api", since = "1.36.0")] pub unsafe fn from_raw(waker: RawWaker) -> Waker { Waker { waker } -- cgit 1.4.1-3-g733a5