about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2018-12-23 23:09:04 +0100
committerGitHub <noreply@github.com>2018-12-23 23:09:04 +0100
commit93af1e73696c82de22eb445423f10df35130dded (patch)
treedeaa2f71918324d93ea6196f7fc4834bff83ec16 /src/libstd
parent6ce5ecbc2a6c7e323f8194229327c179cb7d976d (diff)
parent861df06e077bb17c2d22ab978e37ee2c5350ff9b (diff)
downloadrust-93af1e73696c82de22eb445423f10df35130dded.tar.gz
rust-93af1e73696c82de22eb445423f10df35130dded.zip
Rollup merge of #56939 - cramertj:pin-stabilization, r=alexcrichton
Pin stabilization

This implements the changes suggested in https://github.com/rust-lang/rust/issues/55766#issue-378417538 and stabilizes the `pin` feature. @alexcrichton also listed several "blockers" in that issue, but then in [this comment](https://github.com/rust-lang/rust/issues/55766#issuecomment-445074980) mentioned that they're more "TODO items":
>  In that vein I think it's fine for a stabilization PR to be posted at any time now with FCP lapsed for a week or so now. The final points about self/pin/pinned can be briefly discussed there (if even necessary, they could be left as the proposal above).

Let's settle these last bits here and get this thing stabilized! :)

r? @alexcrichton
cc @withoutboats
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/future.rs2
-rw-r--r--src/libstd/lib.rs3
2 files changed, 2 insertions, 3 deletions
diff --git a/src/libstd/future.rs b/src/libstd/future.rs
index d5e6cab948b..3379be79186 100644
--- a/src/libstd/future.rs
+++ b/src/libstd/future.rs
@@ -43,7 +43,7 @@ impl<T: Generator<Yield = ()>> !Unpin for GenFuture<T> {}
 impl<T: Generator<Yield = ()>> Future for GenFuture<T> {
     type Output = T::Return;
     fn poll(self: Pin<&mut Self>, lw: &LocalWaker) -> Poll<Self::Output> {
-        set_task_waker(lw, || match unsafe { Pin::get_mut_unchecked(self).0.resume() } {
+        set_task_waker(lw, || match unsafe { Pin::get_unchecked_mut(self).0.resume() } {
             GeneratorState::Yielded(()) => Poll::Pending,
             GeneratorState::Complete(x) => Poll::Ready(x),
         })
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index 0d3de34fe64..85c62d0e1e9 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -282,7 +282,6 @@
 #![feature(optin_builtin_traits)]
 #![feature(panic_internals)]
 #![feature(panic_unwind)]
-#![feature(pin)]
 #![feature(prelude_import)]
 #![feature(ptr_internals)]
 #![feature(raw)]
@@ -434,7 +433,7 @@ pub use alloc_crate::borrow;
 pub use alloc_crate::fmt;
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use alloc_crate::format;
-#[unstable(feature = "pin", issue = "49150")]
+#[stable(feature = "pin", since = "1.33.0")]
 pub use core::pin;
 #[stable(feature = "rust1", since = "1.0.0")]
 pub use alloc_crate::slice;