]> git.lizzy.rs Git - rust.git/commitdiff
fix futures aliasing mutable and shared ref
authorRalf Jung <post@ralfj.de>
Wed, 28 Nov 2018 18:29:03 +0000 (19:29 +0100)
committerRalf Jung <post@ralfj.de>
Wed, 28 Nov 2018 18:30:11 +0000 (19:30 +0100)
src/libstd/future.rs

index 1cadbdc66c3986e76e0eb30914f1cd80c3e05c8b..d5e6cab948b8fa28adc5d4b59ece3da03a41b783 100644 (file)
@@ -95,10 +95,10 @@ pub fn get_task_waker<F, R>(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")]