@@ -327,7 +327,10 @@ impl<T, A: AllocRef> Box<T, A> {
327
327
/// `x` will be pinned in memory and unable to be moved.
328
328
#[ unstable( feature = "allocator_api" , issue = "32838" ) ]
329
329
#[ inline( always) ]
330
- pub fn pin_in ( x : T , alloc : A ) -> Pin < Self > {
330
+ pub fn pin_in ( x : T , alloc : A ) -> Pin < Self >
331
+ where
332
+ A : ' static ,
333
+ {
331
334
Self :: new_in ( x, alloc) . into ( )
332
335
}
333
336
@@ -802,7 +805,10 @@ impl<T: ?Sized, A: AllocRef> Box<T, A> {
802
805
///
803
806
/// This is also available via [`From`].
804
807
#[ unstable( feature = "box_into_pin" , issue = "62370" ) ]
805
- pub fn into_pin ( boxed : Self ) -> Pin < Self > {
808
+ pub fn into_pin ( boxed : Self ) -> Pin < Self >
809
+ where
810
+ A : ' static ,
811
+ {
806
812
// It's not possible to move or replace the insides of a `Pin<Box<T>>`
807
813
// when `T: !Unpin`, so it's safe to pin it directly without any
808
814
// additional requirements.
@@ -1010,7 +1016,10 @@ impl<T> From<T> for Box<T> {
1010
1016
}
1011
1017
1012
1018
#[ stable( feature = "pin" , since = "1.33.0" ) ]
1013
- impl < T : ?Sized , A : AllocRef > From < Box < T , A > > for Pin < Box < T , A > > {
1019
+ impl < T : ?Sized , A : AllocRef > From < Box < T , A > > for Pin < Box < T , A > >
1020
+ where
1021
+ A : ' static ,
1022
+ {
1014
1023
/// Converts a `Box<T>` into a `Pin<Box<T>>`
1015
1024
///
1016
1025
/// This conversion does not allocate on the heap and happens in place.
@@ -1413,10 +1422,13 @@ impl<T: ?Sized, A: AllocRef> AsMut<T> for Box<T, A> {
1413
1422
* could have a method to project a Pin<T> from it.
1414
1423
*/
1415
1424
#[ stable( feature = "pin" , since = "1.33.0" ) ]
1416
- impl < T : ?Sized , A : AllocRef > Unpin for Box < T , A > { }
1425
+ impl < T : ?Sized , A : AllocRef > Unpin for Box < T , A > where A : ' static { }
1417
1426
1418
1427
#[ unstable( feature = "generator_trait" , issue = "43122" ) ]
1419
- impl < G : ?Sized + Generator < R > + Unpin , R , A : AllocRef > Generator < R > for Box < G , A > {
1428
+ impl < G : ?Sized + Generator < R > + Unpin , R , A : AllocRef > Generator < R > for Box < G , A >
1429
+ where
1430
+ A : ' static ,
1431
+ {
1420
1432
type Yield = G :: Yield ;
1421
1433
type Return = G :: Return ;
1422
1434
@@ -1426,7 +1438,10 @@ impl<G: ?Sized + Generator<R> + Unpin, R, A: AllocRef> Generator<R> for Box<G, A
1426
1438
}
1427
1439
1428
1440
#[ unstable( feature = "generator_trait" , issue = "43122" ) ]
1429
- impl < G : ?Sized + Generator < R > , R , A : AllocRef > Generator < R > for Pin < Box < G , A > > {
1441
+ impl < G : ?Sized + Generator < R > , R , A : AllocRef > Generator < R > for Pin < Box < G , A > >
1442
+ where
1443
+ A : ' static ,
1444
+ {
1430
1445
type Yield = G :: Yield ;
1431
1446
type Return = G :: Return ;
1432
1447
@@ -1436,7 +1451,10 @@ impl<G: ?Sized + Generator<R>, R, A: AllocRef> Generator<R> for Pin<Box<G, A>> {
1436
1451
}
1437
1452
1438
1453
#[ stable( feature = "futures_api" , since = "1.36.0" ) ]
1439
- impl < F : ?Sized + Future + Unpin , A : AllocRef > Future for Box < F , A > {
1454
+ impl < F : ?Sized + Future + Unpin , A : AllocRef > Future for Box < F , A >
1455
+ where
1456
+ A : ' static ,
1457
+ {
1440
1458
type Output = F :: Output ;
1441
1459
1442
1460
fn poll ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Self :: Output > {
0 commit comments