We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 91b61a4 commit 3b196fbCopy full SHA for 3b196fb
library/alloc/src/task.rs
@@ -39,6 +39,7 @@ use crate::sync::Arc;
39
/// use std::sync::Arc;
40
/// use std::task::{Context, Poll, Wake};
41
/// use std::thread::{self, Thread};
42
+/// use core::pin::pin;
43
///
44
/// /// A waker that wakes up the current thread when called.
45
/// struct ThreadWaker(Thread);
@@ -52,7 +53,7 @@ use crate::sync::Arc;
52
53
/// /// Run a future to completion on the current thread.
54
/// fn block_on<T>(fut: impl Future<Output = T>) -> T {
55
/// // Pin the future so it can be polled.
-/// let mut fut = Box::pin(fut);
56
+/// let mut fut = pin!(fut);
57
58
/// // Create a new context to be passed to the future.
59
/// let t = thread::current();
0 commit comments