Implement Unpin for references

These don'town the backing storage for their data,
so projecting `PinMut` into their fields is already unsound.
This commit is contained in:
Taylor Cramer 2018-06-29 19:30:06 -07:00
parent 5fdcd3aa38
commit 2ce61c0aed

View File

@ -625,6 +625,12 @@ pub struct Pinned;
#[unstable(feature = "pin", issue = "49150")]
impl !Unpin for Pinned {}
#[unstable(feature = "pin", issue = "49150")]
impl<'a, T: ?Sized + 'a> Unpin for &'a T {}
#[unstable(feature = "pin", issue = "49150")]
impl<'a, T: ?Sized + 'a> Unpin for &'a mut T {}
/// Implementations of `Copy` for primitive types.
///
/// Implementations that cannot be described in Rust