Skip to content

Commit 2fb307a

Browse files
authored
Rollup merge of rust-lang#74316 - yoshuawuyts:no-wake-type-hints, r=Mark-Simulacrum
Remove unnecessary type hints from Wake internals While working on rust-lang#74304 I noticed we were writing out the type signature twice in some internal `Wake` impl methods; this streamlines that. Thanks!
2 parents 99c0b97 + 0e9a20f commit 2fb307a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/liballoc/task.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,13 @@ fn raw_waker<W: Wake + Send + Sync + 'static>(waker: Arc<W>) -> RawWaker {
6969

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

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

0 commit comments

Comments
 (0)