@@ -10,6 +10,7 @@ use core::pin::Pin;
10
10
11
11
use crate :: fns:: { inspect_fn, into_fn, ok_fn, InspectFn , IntoFn , OkFn } ;
12
12
use crate :: future:: { assert_future, Either } ;
13
+ use crate :: pin_mut;
13
14
use crate :: stream:: assert_stream;
14
15
#[ cfg( feature = "alloc" ) ]
15
16
use futures_core:: future:: { BoxFuture , LocalBoxFuture } ;
@@ -111,36 +112,6 @@ mod shared;
111
112
#[ cfg( any( feature = "std" , all( feature = "alloc" , feature = "spin" ) ) ) ]
112
113
pub use self :: shared:: { Shared , WeakShared } ;
113
114
114
- /// Pins a value on the stack.
115
- ///
116
- /// **Note:** Since Rust 1.68, this macro is soft-deprecated in favor of
117
- /// [`pin!`](https://doc.rust-lang.org/std/pin/macro.pin.html) macro
118
- /// in the standard library.
119
- ///
120
- /// # Example
121
- ///
122
- /// ```rust
123
- /// # use futures_util::pin_mut;
124
- /// # use core::pin::Pin;
125
- /// # struct Foo {}
126
- /// let foo = Foo { /* ... */ };
127
- /// pin_mut!(foo);
128
- /// let _: Pin<&mut Foo> = foo;
129
- /// ```
130
- #[ macro_export]
131
- macro_rules! pin_mut {
132
- ( $( $x: ident) ,* $( , ) ?) => { $(
133
- // Move the value to ensure that it is owned
134
- let mut $x = $x;
135
- // Shadow the original binding so that it can't be directly accessed
136
- // ever again.
137
- #[ allow( unused_mut) ]
138
- let mut $x = unsafe {
139
- :: core:: pin:: Pin :: new_unchecked( & mut $x)
140
- } ;
141
- ) * }
142
- }
143
-
144
115
impl < T : ?Sized > FutureExt for T where T : Future { }
145
116
146
117
/// An extension trait for `Future`s that provides a variety of convenient
0 commit comments