97
97
//! // std::mem::swap(&mut *still_unmoved, &mut *new_unmoved);
98
98
//! ```
99
99
100
- #![ unstable ( feature = "pin" , issue = "49150 " ) ]
100
+ #![ stable ( feature = "pin" , since = "1.33.0 " ) ]
101
101
102
102
use fmt;
103
103
use marker:: { Sized , Unpin } ;
@@ -116,7 +116,7 @@ use ops::{Deref, DerefMut, CoerceUnsized, DispatchFromDyn};
116
116
//
117
117
// Note: the derives below are allowed because they all only use `&P`, so they
118
118
// cannot move the value behind `pointer`.
119
- #[ unstable ( feature = "pin" , issue = "49150 " ) ]
119
+ #[ stable ( feature = "pin" , since = "1.33.0 " ) ]
120
120
#[ fundamental]
121
121
#[ repr( transparent) ]
122
122
#[ derive( Copy , Clone , Hash , Eq , PartialEq , Ord , PartialOrd ) ]
@@ -130,7 +130,7 @@ where
130
130
{
131
131
/// Construct a new `Pin` around a pointer to some data of a type that
132
132
/// implements `Unpin`.
133
- #[ unstable ( feature = "pin" , issue = "49150 " ) ]
133
+ #[ stable ( feature = "pin" , since = "1.33.0 " ) ]
134
134
#[ inline( always) ]
135
135
pub fn new ( pointer : P ) -> Pin < P > {
136
136
// Safety: the value pointed to is `Unpin`, and so has no requirements
@@ -152,14 +152,14 @@ impl<P: Deref> Pin<P> {
152
152
///
153
153
/// If `pointer` dereferences to an `Unpin` type, `Pin::new` should be used
154
154
/// instead.
155
- #[ unstable ( feature = "pin" , issue = "49150 " ) ]
155
+ #[ stable ( feature = "pin" , since = "1.33.0 " ) ]
156
156
#[ inline( always) ]
157
157
pub unsafe fn new_unchecked ( pointer : P ) -> Pin < P > {
158
158
Pin { pointer }
159
159
}
160
160
161
161
/// Get a pinned shared reference from this pinned pointer.
162
- #[ unstable ( feature = "pin" , issue = "49150 " ) ]
162
+ #[ stable ( feature = "pin" , since = "1.33.0 " ) ]
163
163
#[ inline( always) ]
164
164
pub fn as_ref ( self : & Pin < P > ) -> Pin < & P :: Target > {
165
165
unsafe { Pin :: new_unchecked ( & * self . pointer ) }
@@ -168,14 +168,14 @@ impl<P: Deref> Pin<P> {
168
168
169
169
impl < P : DerefMut > Pin < P > {
170
170
/// Get a pinned mutable reference from this pinned pointer.
171
- #[ unstable ( feature = "pin" , issue = "49150 " ) ]
171
+ #[ stable ( feature = "pin" , since = "1.33.0 " ) ]
172
172
#[ inline( always) ]
173
173
pub fn as_mut ( self : & mut Pin < P > ) -> Pin < & mut P :: Target > {
174
174
unsafe { Pin :: new_unchecked ( & mut * self . pointer ) }
175
175
}
176
176
177
177
/// Assign a new value to the memory behind the pinned reference.
178
- #[ unstable ( feature = "pin" , issue = "49150 " ) ]
178
+ #[ stable ( feature = "pin" , since = "1.33.0 " ) ]
179
179
#[ inline( always) ]
180
180
pub fn set ( mut self : Pin < P > , value : P :: Target )
181
181
where
@@ -197,7 +197,7 @@ impl<'a, T: ?Sized> Pin<&'a T> {
197
197
/// will not move so long as the argument value does not move (for example,
198
198
/// because it is one of the fields of that value), and also that you do
199
199
/// not move out of the argument you receive to the interior function.
200
- #[ unstable ( feature = "pin" , issue = "49150 " ) ]
200
+ #[ stable ( feature = "pin" , since = "1.33.0 " ) ]
201
201
pub unsafe fn map_unchecked < U , F > ( self : Pin < & ' a T > , func : F ) -> Pin < & ' a U > where
202
202
F : FnOnce ( & T ) -> & U ,
203
203
{
@@ -213,7 +213,7 @@ impl<'a, T: ?Sized> Pin<&'a T> {
213
213
/// that lives for as long as the borrow of the `Pin`, not the lifetime of
214
214
/// the `Pin` itself. This method allows turning the `Pin` into a reference
215
215
/// with the same lifetime as the original `Pin`.
216
- #[ unstable ( feature = "pin" , issue = "49150 " ) ]
216
+ #[ stable ( feature = "pin" , since = "1.33.0 " ) ]
217
217
#[ inline( always) ]
218
218
pub fn get_ref ( self : Pin < & ' a T > ) -> & ' a T {
219
219
self . pointer
@@ -222,7 +222,7 @@ impl<'a, T: ?Sized> Pin<&'a T> {
222
222
223
223
impl < ' a , T : ?Sized > Pin < & ' a mut T > {
224
224
/// Convert this `Pin<&mut T>` into a `Pin<&T>` with the same lifetime.
225
- #[ unstable ( feature = "pin" , issue = "49150 " ) ]
225
+ #[ stable ( feature = "pin" , since = "1.33.0 " ) ]
226
226
#[ inline( always) ]
227
227
pub fn into_ref ( self : Pin < & ' a mut T > ) -> Pin < & ' a T > {
228
228
Pin { pointer : self . pointer }
@@ -237,7 +237,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
237
237
/// that lives for as long as the borrow of the `Pin`, not the lifetime of
238
238
/// the `Pin` itself. This method allows turning the `Pin` into a reference
239
239
/// with the same lifetime as the original `Pin`.
240
- #[ unstable ( feature = "pin" , issue = "49150 " ) ]
240
+ #[ stable ( feature = "pin" , since = "1.33.0 " ) ]
241
241
#[ inline( always) ]
242
242
pub fn get_mut ( self : Pin < & ' a mut T > ) -> & ' a mut T
243
243
where T : Unpin ,
@@ -255,7 +255,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
255
255
///
256
256
/// If the underlying data is `Unpin`, `Pin::get_mut` should be used
257
257
/// instead.
258
- #[ unstable ( feature = "pin" , issue = "49150 " ) ]
258
+ #[ stable ( feature = "pin" , since = "1.33.0 " ) ]
259
259
#[ inline( always) ]
260
260
pub unsafe fn get_unchecked_mut ( self : Pin < & ' a mut T > ) -> & ' a mut T {
261
261
self . pointer
@@ -272,7 +272,7 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
272
272
/// will not move so long as the argument value does not move (for example,
273
273
/// because it is one of the fields of that value), and also that you do
274
274
/// not move out of the argument you receive to the interior function.
275
- #[ unstable ( feature = "pin" , issue = "49150 " ) ]
275
+ #[ stable ( feature = "pin" , since = "1.33.0 " ) ]
276
276
pub unsafe fn map_unchecked_mut < U , F > ( self : Pin < & ' a mut T > , func : F ) -> Pin < & ' a mut U > where
277
277
F : FnOnce ( & mut T ) -> & mut U ,
278
278
{
@@ -282,15 +282,15 @@ impl<'a, T: ?Sized> Pin<&'a mut T> {
282
282
}
283
283
}
284
284
285
- #[ unstable ( feature = "pin" , issue = "49150 " ) ]
285
+ #[ stable ( feature = "pin" , since = "1.33.0 " ) ]
286
286
impl < P : Deref > Deref for Pin < P > {
287
287
type Target = P :: Target ;
288
288
fn deref ( & self ) -> & P :: Target {
289
289
Pin :: get_ref ( Pin :: as_ref ( self ) )
290
290
}
291
291
}
292
292
293
- #[ unstable ( feature = "pin" , issue = "49150 " ) ]
293
+ #[ stable ( feature = "pin" , since = "1.33.0 " ) ]
294
294
impl < P : DerefMut > DerefMut for Pin < P >
295
295
where
296
296
P :: Target : Unpin
@@ -300,21 +300,21 @@ where
300
300
}
301
301
}
302
302
303
- #[ unstable ( feature = "pin" , issue = "49150 " ) ]
303
+ #[ stable ( feature = "pin" , since = "1.33.0 " ) ]
304
304
impl < P : fmt:: Debug > fmt:: Debug for Pin < P > {
305
305
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
306
306
fmt:: Debug :: fmt ( & self . pointer , f)
307
307
}
308
308
}
309
309
310
- #[ unstable ( feature = "pin" , issue = "49150 " ) ]
310
+ #[ stable ( feature = "pin" , since = "1.33.0 " ) ]
311
311
impl < P : fmt:: Display > fmt:: Display for Pin < P > {
312
312
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
313
313
fmt:: Display :: fmt ( & self . pointer , f)
314
314
}
315
315
}
316
316
317
- #[ unstable ( feature = "pin" , issue = "49150 " ) ]
317
+ #[ stable ( feature = "pin" , since = "1.33.0 " ) ]
318
318
impl < P : fmt:: Pointer > fmt:: Pointer for Pin < P > {
319
319
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
320
320
fmt:: Pointer :: fmt ( & self . pointer , f)
@@ -326,13 +326,13 @@ impl<P: fmt::Pointer> fmt::Pointer for Pin<P> {
326
326
// `Deref<Target=Unpin>` is unsound. Any such impl would probably be unsound
327
327
// for other reasons, though, so we just need to take care not to allow such
328
328
// impls to land in std.
329
- #[ unstable ( feature = "pin" , issue = "49150 " ) ]
329
+ #[ stable ( feature = "pin" , since = "1.33.0 " ) ]
330
330
impl < P , U > CoerceUnsized < Pin < U > > for Pin < P >
331
331
where
332
332
P : CoerceUnsized < U > ,
333
333
{ }
334
334
335
- #[ unstable ( feature = "pin" , issue = "49150 " ) ]
335
+ #[ stable ( feature = "pin" , since = "1.33.0 " ) ]
336
336
impl < ' a , P , U > DispatchFromDyn < Pin < U > > for Pin < P >
337
337
where
338
338
P : DispatchFromDyn < U > ,
0 commit comments