Skip to content

Commit 2ce61c0

Browse files
committed
Implement Unpin for references
These don'town the backing storage for their data, so projecting `PinMut` into their fields is already unsound.
1 parent 5fdcd3a commit 2ce61c0

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
@@ -625,6 +625,12 @@ pub struct Pinned;
625625
#[unstable(feature = "pin", issue = "49150")]
626626
impl !Unpin for Pinned {}
627627

628+
#[unstable(feature = "pin", issue = "49150")]
629+
impl<'a, T: ?Sized + 'a> Unpin for &'a T {}
630+
631+
#[unstable(feature = "pin", issue = "49150")]
632+
impl<'a, T: ?Sized + 'a> Unpin for &'a mut T {}
633+
628634
/// Implementations of `Copy` for primitive types.
629635
///
630636
/// Implementations that cannot be described in Rust

0 commit comments

Comments
 (0)