Skip to content

Commit

Permalink
Rollup merge of rust-lang#62583 - sfackler:unpin-raw, r=cramertj
Browse files Browse the repository at this point in the history
Implement Unpin for all raw pointers

Like references and boxes, moving the pointer doesn't move the
pointed-to value, so this is safe.

r? @cramertj
  • Loading branch information
Centril authored Jul 26, 2019
2 parents 625aa60 + 5a4845d commit d1f86c1
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 d1f86c1

Please sign in to comment.