about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTaylor Cramer <cramertj@google.com>2018-06-29 19:33:16 -0700
committerTaylor Cramer <cramertj@google.com>2018-06-29 19:33:16 -0700
commita2b21e58192134c5ec7d92000460b500f88003e8 (patch)
tree5cda9fd5d403642009fc4dc315616aa26c909be1
parent2ce61c0aedb54c146c03608757b4e9a25d844025 (diff)
downloadrust-a2b21e58192134c5ec7d92000460b500f88003e8.tar.gz
rust-a2b21e58192134c5ec7d92000460b500f88003e8.zip
Make Waker and LocalWaker Unpin
These types never project pinned-ness into their contents,
so it is safe for them to be `Unpin`.
-rw-r--r--src/libcore/task/wake.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libcore/task/wake.rs b/src/libcore/task/wake.rs
index 4fd45be56fb..418d5af006f 100644
--- a/src/libcore/task/wake.rs
+++ b/src/libcore/task/wake.rs
@@ -13,6 +13,7 @@
             issue = "50547")]
 
 use fmt;
+use marker::Unpin;
 use ptr::NonNull;
 
 /// A `Waker` is a handle for waking up a task by notifying its executor that it
@@ -25,6 +26,7 @@ pub struct Waker {
     inner: NonNull<UnsafeWake>,
 }
 
+impl Unpin for Waker {}
 unsafe impl Send for Waker {}
 unsafe impl Sync for Waker {}
 
@@ -99,6 +101,7 @@ pub struct LocalWaker {
     inner: NonNull<UnsafeWake>,
 }
 
+impl Unpin for LocalWaker {}
 impl !Send for LocalWaker {}
 impl !Sync for LocalWaker {}