From 5a4845d0d44e4d3c4fab3ae45730d319ab3133af Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Wed, 10 Jul 2019 21:58:01 -0700 Subject: [PATCH] Implement Unpin for all raw pointers Like references and boxes, moving the pointer doesn't move the pointed-to value, so this is safe. --- src/libcore/marker.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs index 39c390b4df6d3..79a188dbac99d 100644 --- a/src/libcore/marker.rs +++ b/src/libcore/marker.rs @@ -655,6 +655,12 @@ impl<'a, T: ?Sized + 'a> Unpin for &'a T {} #[stable(feature = "pin", since = "1.33.0")] impl<'a, T: ?Sized + 'a> Unpin for &'a mut T {} +#[stable(feature = "pin_raw", since = "1.38.0")] +impl Unpin for *const T {} + +#[stable(feature = "pin_raw", since = "1.38.0")] +impl Unpin for *mut T {} + /// Implementations of `Copy` for primitive types. /// /// Implementations that cannot be described in Rust