Skip to content

Unpin references #51935

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/libcore/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/libcore/task/wake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
issue = "50547")]

use fmt;
use marker::Unpin;
use ptr::NonNull;

/// A `Waker` is a handle for waking up a task by notifying its executor that it
Expand All @@ -25,6 +26,7 @@ pub struct Waker {
inner: NonNull<UnsafeWake>,
}

impl Unpin for Waker {}
unsafe impl Send for Waker {}
unsafe impl Sync for Waker {}

Expand Down Expand Up @@ -99,6 +101,7 @@ pub struct LocalWaker {
inner: NonNull<UnsafeWake>,
}

impl Unpin for LocalWaker {}
impl !Send for LocalWaker {}
impl !Sync for LocalWaker {}

Expand Down