Skip to content

Commit

Permalink
Rollup merge of rust-lang#110796 - madsravn:wake-example, r=Mark-Simu…
Browse files Browse the repository at this point in the history
…lacrum

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.
  • Loading branch information
matthiaskrgr authored Apr 25, 2023
2 parents f5a3039 + 3b196fb commit 77752a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/alloc/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ use crate::sync::Arc;
/// use std::sync::Arc;
/// use std::task::{Context, Poll, Wake};
/// use std::thread::{self, Thread};
/// use core::pin::pin;
///
/// /// A waker that wakes up the current thread when called.
/// struct ThreadWaker(Thread);
Expand All @@ -52,7 +53,7 @@ use crate::sync::Arc;
/// /// Run a future to completion on the current thread.
/// fn block_on<T>(fut: impl Future<Output = T>) -> T {
/// // Pin the future so it can be polled.
/// let mut fut = Box::pin(fut);
/// let mut fut = pin!(fut);
///
/// // Create a new context to be passed to the future.
/// let t = thread::current();
Expand Down

0 comments on commit 77752a0

Please sign in to comment.