Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #70330

Merged
merged 28 commits into from
Mar 23, 2020
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c57de34
Stabilize --crate-version option in rustdoc
GuillaumeGomez Feb 26, 2020
7d40019
rustc_mir: remove extra space when pretty-printing MIR.
anyska Mar 17, 2020
f1188f7
Add test for issue #53275
rylev Mar 20, 2020
ebf27fa
Revised span-to-lines conversion to produce an empty vec on DUMMY_SP.
pnkfelix Mar 13, 2020
da5d03d
Add missing -Z unstable-options flag
aleksator Mar 20, 2020
4803f29
add err_machine_stop macro
RalfJung Mar 23, 2020
b35c302
Reword unused variable warning
aleksator Mar 23, 2020
821eef5
Make sure issue 53275 test goes through codegen
rylev Mar 23, 2020
403ba61
Rename remaining occurences of Void to Opaque.
anyska Mar 23, 2020
06ede35
Add Wake trait for safe construction of Wakers.
withoutboats Jan 31, 2020
d8a835f
Add `wake_trait` feature directive to std
withoutboats Jan 31, 2020
c9acdb0
Improve safety implementation, fix typos
withoutboats Jan 31, 2020
ede03a4
typo
withoutboats Jan 31, 2020
3ae74ca
More explicit; CFG on atomic pointer
withoutboats Feb 2, 2020
a4875a7
Update src/libstd/lib.rs
withoutboats Mar 23, 2020
caff9f9
Update src/liballoc/task.rs
withoutboats Mar 23, 2020
32f5724
Apply suggestions from code review
withoutboats Mar 23, 2020
fcb4e77
Split long derive lists into two derive attributes.
anyska Mar 23, 2020
763121d
Update src/librustc_span/source_map.rs
pnkfelix Mar 23, 2020
e4d2f74
Rollup merge of #68700 - withoutboats:wake-trait, r=withoutboats
Centril Mar 23, 2020
e37e81c
Rollup merge of #69494 - GuillaumeGomez:stabilize-crate-version, r=eh…
Centril Mar 23, 2020
4d5ecca
Rollup merge of #70080 - anyska:mir-double-space, r=oli-obk
Centril Mar 23, 2020
ad6d303
Rollup merge of #70195 - rylev:test-for-53275, r=Centril
Centril Mar 23, 2020
560eae3
Rollup merge of #70199 - pnkfelix:issue-68808-dont-turn-dummy-spans-i…
Centril Mar 23, 2020
8cb3daa
Rollup merge of #70299 - RalfJung:err_machine_stop, r=oli-obk
Centril Mar 23, 2020
1bb0c92
Rollup merge of #70300 - aleksator:66636_reword_unused_variable_warni…
Centril Mar 23, 2020
176e2eb
Rollup merge of #70315 - anyska:void-rename, r=Mark-Simulacrum
Centril Mar 23, 2020
5b29348
Rollup merge of #70318 - anyska:multiple-derives, r=Dylan-DPC
Centril Mar 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
More explicit; CFG on atomic pointer
  • Loading branch information
withoutboats committed Mar 23, 2020
commit 3ae74cafe483b16c6810a4ff34de03da4974b1ce
1 change: 1 addition & 0 deletions src/liballoc/lib.rs
Original file line number Diff line number Diff line change
@@ -161,6 +161,7 @@ pub mod str;
pub mod string;
#[cfg(target_has_atomic = "ptr")]
pub mod sync;
#[cfg(target_has_atomic = "ptr")]
pub mod task;
#[cfg(test)]
mod tests;
6 changes: 3 additions & 3 deletions src/liballoc/task.rs
Original file line number Diff line number Diff line change
@@ -59,20 +59,20 @@ fn raw_waker<W: Wake + Send + Sync + 'static>(waker: Arc<W>) -> RawWaker {
// Increment the reference count of the arc to clone it.
unsafe fn clone_waker<W: Wake + Send + Sync + 'static>(waker: *const ()) -> RawWaker {
let waker: Arc<W> = Arc::from_raw(waker as *const W);
mem::forget(waker.clone());
mem::forget(Arc::clone(&waker));
raw_waker(waker)
}

// 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> = Arc::from_raw(waker as *const W);
Wake::wake(waker);
<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>> = ManuallyDrop::new(Arc::from_raw(waker as *const W));
Wake::wake_by_ref(&waker);
<W as Wake>::wake_by_ref(&waker);
}

// Decrement the reference count of the Arc on drop