Skip to content

Commit 7c6a9cb

Browse files
committed
chore: make method order consistent with waker
1 parent eccb5e7 commit 7c6a9cb

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

library/core/src/task/wake.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,19 @@ impl LocalWaker {
710710
self.waker == other.waker
711711
}
712712

713+
/// Creates a new `LocalWaker` from [`RawWaker`].
714+
///
715+
/// The behavior of the returned `LocalWaker` is undefined if the contract defined
716+
/// in [`RawWaker`]'s and [`RawWakerVTable`]'s documentation is not upheld.
717+
/// Therefore this method is unsafe.
718+
#[inline]
719+
#[must_use]
720+
#[stable(feature = "futures_api", since = "1.36.0")]
721+
#[rustc_const_unstable(feature = "const_waker", issue = "102012")]
722+
pub const unsafe fn from_raw(waker: RawWaker) -> LocalWaker {
723+
Self { waker }
724+
}
725+
713726
/// Creates a new `LocalWaker` that does nothing when `wake` is called.
714727
///
715728
/// This is mostly useful for writing tests that need a [`Context`] to poll
@@ -740,19 +753,6 @@ impl LocalWaker {
740753
WAKER
741754
}
742755

743-
/// Creates a new `LocalWaker` from [`RawWaker`].
744-
///
745-
/// The behavior of the returned `LocalWaker` is undefined if the contract defined
746-
/// in [`RawWaker`]'s and [`RawWakerVTable`]'s documentation is not upheld.
747-
/// Therefore this method is unsafe.
748-
#[inline]
749-
#[must_use]
750-
#[stable(feature = "futures_api", since = "1.36.0")]
751-
#[rustc_const_unstable(feature = "const_waker", issue = "102012")]
752-
pub const unsafe fn from_raw(waker: RawWaker) -> LocalWaker {
753-
Self { waker }
754-
}
755-
756756
/// Get a reference to the underlying [`RawWaker`].
757757
#[inline]
758758
#[must_use]

0 commit comments

Comments
 (0)