diff options
| author | bors <bors@rust-lang.org> | 2020-07-14 17:11:02 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-07-14 17:11:02 +0000 |
| commit | 2002ebacfbca288830a3c308ddc8189705c608fe (patch) | |
| tree | d02268730c1ae866eb4a1ec31e144592b868be3d /src/liballoc/task.rs | |
| parent | c724b67e1b474262917a5154d74e7072267593fe (diff) | |
| parent | 5414eae4521d0b6141b9db4c44be144757e5d5fb (diff) | |
| download | rust-2002ebacfbca288830a3c308ddc8189705c608fe.tar.gz rust-2002ebacfbca288830a3c308ddc8189705c608fe.zip | |
Auto merge of #74330 - Manishearth:rollup-mrc09pb, r=Manishearth
Rollup of 15 pull requests Successful merges: - #71237 (Add Ayu theme to rustdoc) - #73720 (Clean up E0704 error explanation) - #73866 (Obviate #[allow(improper_ctypes_definitions)]) - #73965 (typeck: check for infer before type impls trait) - #73986 (add (unchecked) indexing methods to raw (and NonNull) slices) - #74173 (Detect tuple struct incorrectly used as struct pat) - #74220 (Refactor Windows `parse_prefix`) - #74227 (Remove an unwrap in layout computation) - #74239 (Update llvm-project to latest origin/rustc/10.0-2020-05-05 commit ) - #74257 (don't mark linux kernel module targets as a unix environment) - #74270 (typeck: report placeholder type error w/out span) - #74296 (Clarify the description for rfind) - #74310 (Use `ArrayVec` in `SparseBitSet`.) - #74316 (Remove unnecessary type hints from Wake internals) - #74324 (Update Clippy) Failed merges: r? @ghost
Diffstat (limited to 'src/liballoc/task.rs')
| -rw-r--r-- | src/liballoc/task.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/liballoc/task.rs b/src/liballoc/task.rs index 0d1cc99df47..252e04a4105 100644 --- a/src/liballoc/task.rs +++ b/src/liballoc/task.rs @@ -69,14 +69,13 @@ fn raw_waker<W: Wake + Send + Sync + 'static>(waker: Arc<W>) -> RawWaker { // Wake by value, moving the Arc into the Wake::wake function unsafe fn wake<W: Wake + Send + Sync + 'static>(waker: *const ()) { - let waker: Arc<W> = unsafe { Arc::from_raw(waker as *const W) }; + let waker = unsafe { Arc::from_raw(waker as *const W) }; <W as Wake>::wake(waker); } // Wake by reference, wrap the waker in ManuallyDrop to avoid dropping it unsafe fn wake_by_ref<W: Wake + Send + Sync + 'static>(waker: *const ()) { - let waker: ManuallyDrop<Arc<W>> = - unsafe { ManuallyDrop::new(Arc::from_raw(waker as *const W)) }; + let waker = unsafe { ManuallyDrop::new(Arc::from_raw(waker as *const W)) }; <W as Wake>::wake_by_ref(&waker); } |
