Skip to content

Commit 77752a0

Browse files
authored
Rollup merge of rust-lang#110796 - madsravn:wake-example, r=Mark-Simulacrum
Updating Wake example to use new 'pin!' macro Closes: rust-lang#109965 I have already had this reviewed and approved here: rust-lang#110026 . But because I had some git issues and chose the "nuke it" option as my solution it didn't get merged. I nuked it too quickly. I am sorry for trouble of reviewing twice.
2 parents f5a3039 + 3b196fb commit 77752a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/alloc/src/task.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ use crate::sync::Arc;
3939
/// use std::sync::Arc;
4040
/// use std::task::{Context, Poll, Wake};
4141
/// use std::thread::{self, Thread};
42+
/// use core::pin::pin;
4243
///
4344
/// /// A waker that wakes up the current thread when called.
4445
/// struct ThreadWaker(Thread);
@@ -52,7 +53,7 @@ use crate::sync::Arc;
5253
/// /// Run a future to completion on the current thread.
5354
/// fn block_on<T>(fut: impl Future<Output = T>) -> T {
5455
/// // Pin the future so it can be polled.
55-
/// let mut fut = Box::pin(fut);
56+
/// let mut fut = pin!(fut);
5657
///
5758
/// // Create a new context to be passed to the future.
5859
/// let t = thread::current();

0 commit comments

Comments
 (0)