Skip to content

Commit 3ae74ca

Browse files
committed
More explicit; CFG on atomic pointer
1 parent ede03a4 commit 3ae74ca

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/liballoc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ pub mod str;
161161
pub mod string;
162162
#[cfg(target_has_atomic = "ptr")]
163163
pub mod sync;
164+
#[cfg(target_has_atomic = "ptr")]
164165
pub mod task;
165166
#[cfg(test)]
166167
mod tests;

src/liballoc/task.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,20 @@ fn raw_waker<W: Wake + Send + Sync + 'static>(waker: Arc<W>) -> RawWaker {
5959
// Increment the reference count of the arc to clone it.
6060
unsafe fn clone_waker<W: Wake + Send + Sync + 'static>(waker: *const ()) -> RawWaker {
6161
let waker: Arc<W> = Arc::from_raw(waker as *const W);
62-
mem::forget(waker.clone());
62+
mem::forget(Arc::clone(&waker));
6363
raw_waker(waker)
6464
}
6565

6666
// Wake by value, moving the Arc into the Wake::wake function
6767
unsafe fn wake<W: Wake + Send + Sync + 'static>(waker: *const ()) {
6868
let waker: Arc<W> = Arc::from_raw(waker as *const W);
69-
Wake::wake(waker);
69+
<W as Wake>::wake(waker);
7070
}
7171

7272
// Wake by reference, wrap the waker in ManuallyDrop to avoid dropping it
7373
unsafe fn wake_by_ref<W: Wake + Send + Sync + 'static>(waker: *const ()) {
7474
let waker: ManuallyDrop<Arc<W>> = ManuallyDrop::new(Arc::from_raw(waker as *const W));
75-
Wake::wake_by_ref(&waker);
75+
<W as Wake>::wake_by_ref(&waker);
7676
}
7777

7878
// Decrement the reference count of the Arc on drop

0 commit comments

Comments
 (0)