Skip to content

Commit c67a446

Browse files
fix: Apply suggestions from code review
Co-authored-by: Mark Rousskov <[email protected]>
1 parent a8e71f2 commit c67a446

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

library/alloc/src/task.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,14 @@ fn raw_waker<W: Wake + Send + Sync + 'static>(waker: Arc<W>) -> RawWaker {
168168
/// to hold data that does not implement `Send` and `Sync`. Additionally, it saves calls
169169
/// to `Arc::clone`, which requires atomic synchronization.
170170
///
171-
171+
///
172172
/// # Examples
173173
///
174174
/// This is a simplified example of a `spawn` and a `block_on` function. The `spawn` function
175175
/// is used to push new tasks onto the run queue, while the block on function will remove them
176176
/// and poll them. When a task is woken, it will put itself back on the run queue to be polled by the executor.
177177
///
178-
/// **Note:** A real world example would interlieve poll calls with calls to an io reactor to wait for events instead
178+
/// **Note:** A real world example would interleave poll calls with calls to an io reactor to wait for events instead
179179
/// of spinning on a loop.
180180
///
181181
/// ```rust
@@ -221,7 +221,7 @@ fn raw_waker<W: Wake + Send + Sync + 'static>(waker: Arc<W>) -> RawWaker {
221221
/// {
222222
/// spawn(future);
223223
/// loop {
224-
/// let Some(task) = RUN_QUEUE.with_borrow_mut(|queue|queue.pop_front()) else {
224+
/// let Some(task) = RUN_QUEUE.with_borrow_mut(|queue| queue.pop_front()) else {
225225
/// // we exit, since there are no more tasks remaining on the queue
226226
/// return;
227227
/// };

library/core/src/task/wake.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ impl<'a> ContextBuilder<'a> {
332332
}
333333

334334
/// This field is used to set the value of the waker on `Context`.
335-
336335
#[inline]
337336
#[rustc_const_unstable(feature = "const_waker", issue = "102012")]
338337
#[unstable(feature = "local_waker", issue = "118959")]
@@ -598,6 +597,7 @@ impl fmt::Debug for Waker {
598597
}
599598

600599
/// A `LocalWaker` is analogous to a [`Waker`], but it does not implement [`Send`] or [`Sync`].
600+
///
601601
/// This handle encapsulates a [`RawWaker`] instance, which defines the
602602
/// executor-specific wakeup behavior.
603603
///
@@ -646,9 +646,8 @@ impl fmt::Debug for Waker {
646646
/// [`Future::poll()`]: core::future::Future::poll
647647
/// [`Poll::Pending`]: core::task::Poll::Pending
648648
/// [`local_waker`]: core::task::Context::local_waker
649-
650649
#[unstable(feature = "local_waker", issue = "118959")]
651-
#[repr(transparent)]
650+
#[cfg_attr(not(doc), repr(transparent))] // work around https://github.com/rust-lang/rust/issues/66401
652651
pub struct LocalWaker {
653652
waker: RawWaker,
654653
}

0 commit comments

Comments
 (0)