about summary refs log tree commit diff
path: root/library/core/src/task
diff options
context:
space:
mode:
authorTomás Vallotton <tvallotton@uc.cl>2024-01-13 11:18:18 -0300
committerTomás Vallotton <tvallotton@uc.cl>2024-01-20 10:14:25 -0300
commit7c6a9cbef103c0a9511aedad691a040ceb003917 (patch)
tree10bfa448d8ad25c24adf832ae694a549d76e1fa3 /library/core/src/task
parenteccb5e7c1bc3b36ed19bbca75ddf80470d3f0caa (diff)
downloadrust-7c6a9cbef103c0a9511aedad691a040ceb003917.tar.gz
rust-7c6a9cbef103c0a9511aedad691a040ceb003917.zip
chore: make method order consistent with waker
Diffstat (limited to 'library/core/src/task')
-rw-r--r--library/core/src/task/wake.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/library/core/src/task/wake.rs b/library/core/src/task/wake.rs
index e64a25960e0..6a5b5a3fb54 100644
--- a/library/core/src/task/wake.rs
+++ b/library/core/src/task/wake.rs
@@ -710,6 +710,19 @@ impl LocalWaker {
         self.waker == other.waker
     }
 
+    /// Creates a new `LocalWaker` from [`RawWaker`].
+    ///
+    /// The behavior of the returned `LocalWaker` is undefined if the contract defined
+    /// 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")]
+    #[rustc_const_unstable(feature = "const_waker", issue = "102012")]
+    pub const unsafe fn from_raw(waker: RawWaker) -> LocalWaker {
+        Self { waker }
+    }
+
     /// Creates a new `LocalWaker` that does nothing when `wake` is called.
     ///
     /// This is mostly useful for writing tests that need a [`Context`] to poll
@@ -740,19 +753,6 @@ impl LocalWaker {
         WAKER
     }
 
-    /// Creates a new `LocalWaker` from [`RawWaker`].
-    ///
-    /// The behavior of the returned `LocalWaker` is undefined if the contract defined
-    /// 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")]
-    #[rustc_const_unstable(feature = "const_waker", issue = "102012")]
-    pub const unsafe fn from_raw(waker: RawWaker) -> LocalWaker {
-        Self { waker }
-    }
-
     /// Get a reference to the underlying [`RawWaker`].
     #[inline]
     #[must_use]