diff options
| author | bors <bors@rust-lang.org> | 2018-07-24 03:01:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-07-24 03:01:11 +0000 |
| commit | baba5007bf857b4577a8d26de454a03d7afef3ac (patch) | |
| tree | 0e552f1865570b25ddabb354b6c6119f8979b866 /src/libcore/task | |
| parent | e842dea7a3d9babc7a19bd201711f4243840fab0 (diff) | |
| parent | 3efc612a930822ea1b9c6749a3d146235c324a83 (diff) | |
| download | rust-baba5007bf857b4577a8d26de454a03d7afef3ac.tar.gz rust-baba5007bf857b4577a8d26de454a03d7afef3ac.zip | |
Auto merge of #52655 - kennytm:rollup, r=kennytm
Rollup of 10 pull requests Successful merges: - #52538 (Remove obsolete flags in the i586_musl Dockerfile) - #52548 (Cursor: update docs to clarify Cursor only works with in-memory buffers) - #52605 (Do not suggest using `to_owned()` on `&str += &str`) - #52621 (Fix color detection for Windows msys terminals.) - #52622 (Use MultiSpan in E0707 and E709) - #52627 (Compile rustc before building tests for rustdoc) - #52637 (Don't use NonNull::dangling as sentinel value in Rc, Arc) - #52640 (Forget Waker when cloning LocalWaker) - #52641 (Simplify 2 functions in rustc_mir/dataflow) - #52642 (Replace a few expect+format combos with unwrap_or_else+panic) Failed merges: r? @ghost
Diffstat (limited to 'src/libcore/task')
| -rw-r--r-- | src/libcore/task/wake.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libcore/task/wake.rs b/src/libcore/task/wake.rs index d3df8b50ee2..3b901c9aef0 100644 --- a/src/libcore/task/wake.rs +++ b/src/libcore/task/wake.rs @@ -12,7 +12,7 @@ reason = "futures in libcore are unstable", issue = "50547")] -use fmt; +use {fmt, mem}; use marker::Unpin; use ptr::NonNull; @@ -166,9 +166,10 @@ impl From<LocalWaker> for Waker { impl Clone for LocalWaker { #[inline] fn clone(&self) -> Self { - unsafe { - LocalWaker { inner: self.inner.as_ref().clone_raw().inner } - } + let waker = unsafe { self.inner.as_ref().clone_raw() }; + let inner = waker.inner; + mem::forget(waker); + LocalWaker { inner } } } |
