Skip to content

Commit 5a4845d

Browse files
committed
Implement Unpin for all raw pointers
Like references and boxes, moving the pointer doesn't move the pointed-to value, so this is safe.
1 parent 35cacbc commit 5a4845d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libcore/marker.rs

+6
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,12 @@ impl<'a, T: ?Sized + 'a> Unpin for &'a T {}
655655
#[stable(feature = "pin", since = "1.33.0")]
656656
impl<'a, T: ?Sized + 'a> Unpin for &'a mut T {}
657657

658+
#[stable(feature = "pin_raw", since = "1.38.0")]
659+
impl<T: ?Sized> Unpin for *const T {}
660+
661+
#[stable(feature = "pin_raw", since = "1.38.0")]
662+
impl<T: ?Sized> Unpin for *mut T {}
663+
658664
/// Implementations of `Copy` for primitive types.
659665
///
660666
/// Implementations that cannot be described in Rust

0 commit comments

Comments
 (0)