Skip to content

Commit

Permalink
Implement Unpin for all raw pointers
Browse files Browse the repository at this point in the history
Like references and boxes, moving the pointer doesn't move the
pointed-to value, so this is safe.
  • Loading branch information
sfackler committed Jul 11, 2019
1 parent 35cacbc commit 5a4845d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libcore/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T: ?Sized> Unpin for *const T {}

#[stable(feature = "pin_raw", since = "1.38.0")]
impl<T: ?Sized> Unpin for *mut T {}

/// Implementations of `Copy` for primitive types.
///
/// Implementations that cannot be described in Rust
Expand Down

0 comments on commit 5a4845d

Please sign in to comment.