about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTaylor Cramer <cramertj@google.com>2018-06-29 19:30:06 -0700
committerTaylor Cramer <cramertj@google.com>2018-06-29 19:31:55 -0700
commit2ce61c0aedb54c146c03608757b4e9a25d844025 (patch)
tree035de7696672da2f0e7afe79f50a10c0826fdcc3
parent5fdcd3aa389aa92879f576c55e429015667143c3 (diff)
downloadrust-2ce61c0aedb54c146c03608757b4e9a25d844025.tar.gz
rust-2ce61c0aedb54c146c03608757b4e9a25d844025.zip
Implement Unpin for references
These don'town the backing storage for their data,
so projecting `PinMut` into their fields is already unsound.
-rw-r--r--src/libcore/marker.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs
index 5db5d88d4a5..4a54ebce0a3 100644
--- a/src/libcore/marker.rs
+++ b/src/libcore/marker.rs
@@ -625,6 +625,12 @@ pub struct Pinned;
 #[unstable(feature = "pin", issue = "49150")]
 impl !Unpin for Pinned {}
 
+#[unstable(feature = "pin", issue = "49150")]
+impl<'a, T: ?Sized + 'a> Unpin for &'a T {}
+
+#[unstable(feature = "pin", issue = "49150")]
+impl<'a, T: ?Sized + 'a> Unpin for &'a mut T {}
+
 /// Implementations of `Copy` for primitive types.
 ///
 /// Implementations that cannot be described in Rust