Skip to content

Commit c3bdd76

Browse files
author
Without Boats
committed
Implement Unpin for Box, Rc, and Arc
1 parent aaa170b commit c3bdd76

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/liballoc/boxed.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,9 @@ impl<T: ?Sized> AsMut<T> for Box<T> {
749749
}
750750
}
751751

752+
#[unstable(feature = "pin", issue = "49150")]
753+
impl<T: ?Sized> Unpin for Box<T> { }
754+
752755
#[unstable(feature = "generator_trait", issue = "43122")]
753756
impl<T> Generator for Box<T>
754757
where T: Generator + ?Sized

src/liballoc/rc.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ use core::fmt;
252252
use core::hash::{Hash, Hasher};
253253
use core::intrinsics::abort;
254254
use core::marker;
255-
use core::marker::{Unsize, PhantomData};
255+
use core::marker::{Unpin, Unsize, PhantomData};
256256
use core::mem::{self, align_of_val, forget, size_of_val};
257257
use core::ops::Deref;
258258
use core::ops::CoerceUnsized;
@@ -1830,3 +1830,6 @@ impl<T: ?Sized> AsRef<T> for Rc<T> {
18301830
&**self
18311831
}
18321832
}
1833+
1834+
#[unstable(feature = "pin", issue = "49150")]
1835+
impl<T: ?Sized> Unpin for Box<T> { }

src/liballoc/sync.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use core::mem::{self, align_of_val, size_of_val};
2727
use core::ops::Deref;
2828
use core::ops::CoerceUnsized;
2929
use core::ptr::{self, NonNull};
30-
use core::marker::{Unsize, PhantomData};
30+
use core::marker::{Unpin, Unsize, PhantomData};
3131
use core::hash::{Hash, Hasher};
3232
use core::{isize, usize};
3333
use core::convert::From;
@@ -1942,3 +1942,6 @@ impl<T: ?Sized> AsRef<T> for Arc<T> {
19421942
&**self
19431943
}
19441944
}
1945+
1946+
#[unstable(feature = "pin", issue = "49150")]
1947+
impl<T: ?Sized> Unpin for Arc<T> { }

0 commit comments

Comments
 (0)