about summary refs log tree commit diff
path: root/src/libcore/task
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-07-04 11:32:40 +0000
committerbors <bors@rust-lang.org>2018-07-04 11:32:40 +0000
commita22bcd8aab2905f6f5496c1ae66a45ba60ca4c90 (patch)
treee9117aecadaf9accb712d80e5e0b20a883d9cbff /src/libcore/task
parent8dd715ee5e462384668e3c83c17ee641e9776b64 (diff)
parenta2b21e58192134c5ec7d92000460b500f88003e8 (diff)
downloadrust-a22bcd8aab2905f6f5496c1ae66a45ba60ca4c90.tar.gz
rust-a22bcd8aab2905f6f5496c1ae66a45ba60ca4c90.zip
Auto merge of #51935 - cramertj:unpin-references, r=withoutboats
Unpin references

I also considered adding an impl for raw pointers as well, but that makes it easy to accidentally have unsound owning-collections that might otherwise be able to project pinned-ness (e.g. `Box`).

cc @RalfJung

r? @withoutboats
Diffstat (limited to 'src/libcore/task')
-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 {}