Skip to content

Commit

Permalink
Stabilize ::{core,std}::pin::pin!
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhenrymantilla committed Oct 31, 2022
1 parent 4596f4f commit 0b3061a
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 13 deletions.
7 changes: 2 additions & 5 deletions library/core/src/pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,6 @@ impl<P, U> DispatchFromDyn<Pin<U>> for Pin<P> where P: DispatchFromDyn<U> {}
/// ### Basic usage
///
/// ```rust
/// #![feature(pin_macro)]
/// # use core::marker::PhantomPinned as Foo;
/// use core::pin::{pin, Pin};
///
Expand All @@ -957,7 +956,6 @@ impl<P, U> DispatchFromDyn<Pin<U>> for Pin<P> where P: DispatchFromDyn<U> {}
/// ### Manually polling a `Future` (without `Unpin` bounds)
///
/// ```rust
/// #![feature(pin_macro)]
/// use std::{
/// future::Future,
/// pin::pin,
Expand Down Expand Up @@ -996,7 +994,7 @@ impl<P, U> DispatchFromDyn<Pin<U>> for Pin<P> where P: DispatchFromDyn<U> {}
/// ### With `Generator`s
///
/// ```rust
/// #![feature(generators, generator_trait, pin_macro)]
/// #![feature(generators, generator_trait)]
/// use core::{
/// ops::{Generator, GeneratorState},
/// pin::pin,
Expand Down Expand Up @@ -1039,7 +1037,6 @@ impl<P, U> DispatchFromDyn<Pin<U>> for Pin<P> where P: DispatchFromDyn<U> {}
/// The following, for instance, fails to compile:
///
/// ```rust,compile_fail
/// #![feature(pin_macro)]
/// use core::pin::{pin, Pin};
/// # use core::{marker::PhantomPinned as Foo, mem::drop as stuff};
///
Expand Down Expand Up @@ -1081,7 +1078,7 @@ impl<P, U> DispatchFromDyn<Pin<U>> for Pin<P> where P: DispatchFromDyn<U> {}
/// constructor.
///
/// [`Box::pin`]: ../../std/boxed/struct.Box.html#method.pin
#[unstable(feature = "pin_macro", issue = "93178")]
#[stable(feature = "pin_macro", since = "CURRENT_RUSTC_VERSION")]
#[rustc_macro_transparency = "semitransparent"]
#[allow_internal_unstable(unsafe_pin_internals)]
pub macro pin($value:expr $(,)?) {
Expand Down
1 change: 0 additions & 1 deletion library/core/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#![feature(inline_const)]
#![feature(is_sorted)]
#![feature(pattern)]
#![feature(pin_macro)]
#![feature(sort_internals)]
#![feature(slice_take)]
#![feature(slice_from_ptr_range)]
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/pin-macro/cant_access_internals.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// edition:2018
#![feature(pin_macro)]

use core::{
marker::PhantomPinned,
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/pin-macro/cant_access_internals.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0658]: use of unstable library feature 'unsafe_pin_internals'
--> $DIR/cant_access_internals.rs:12:15
--> $DIR/cant_access_internals.rs:11:15
|
LL | mem::take(phantom_pinned.pointer);
| ^^^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// edition:2018
#![feature(pin_macro)]

use core::{
convert::identity,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0716]: temporary value dropped while borrowed
--> $DIR/lifetime_errors_on_promotion_misusage.rs:12:35
--> $DIR/lifetime_errors_on_promotion_misusage.rs:11:35
|
LL | let phantom_pinned = identity(pin!(PhantomPinned));
| ^^^^^^^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
Expand All @@ -13,7 +13,7 @@ LL | stuff(phantom_pinned)
= note: this error originates in the macro `pin` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0716]: temporary value dropped while borrowed
--> $DIR/lifetime_errors_on_promotion_misusage.rs:19:30
--> $DIR/lifetime_errors_on_promotion_misusage.rs:18:30
|
LL | let phantom_pinned = {
| -------------- borrow later stored here
Expand Down
2 changes: 0 additions & 2 deletions src/tools/miri/tests/pass/issues/issue-miri-2068.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(pin_macro)]

use core::future::Future;
use core::pin::Pin;
use core::task::{Context, Poll};
Expand Down

0 comments on commit 0b3061a

Please sign in to comment.