From: Ralf Jung Date: Wed, 28 Nov 2018 18:29:03 +0000 (+0100) Subject: fix futures aliasing mutable and shared ref X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=46a683111d4827800aae5eab4875c23089dce17e;p=rust.git fix futures aliasing mutable and shared ref --- diff --git a/src/libstd/future.rs b/src/libstd/future.rs index 1cadbdc66c3..d5e6cab948b 100644 --- a/src/libstd/future.rs +++ b/src/libstd/future.rs @@ -95,10 +95,10 @@ pub fn get_task_waker(f: F) -> R }); let _reset_waker = SetOnDrop(waker_ptr); - let mut waker_ptr = waker_ptr.expect( + let waker_ptr = waker_ptr.expect( "TLS LocalWaker not set. This is a rustc bug. \ Please file an issue on https://github.com/rust-lang/rust."); - unsafe { f(waker_ptr.as_mut()) } + unsafe { f(waker_ptr.as_ref()) } } #[unstable(feature = "gen_future", issue = "50547")]