diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index 17ec325e257b0..0a1fe3dbd7730 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -337,6 +337,9 @@ impl From for Cell { } } +#[unstable(feature = "coerce_unsized", issue = "27732")] +impl, U> CoerceUnsized> for Cell {} + /// A mutable memory location with dynamically checked borrow rules /// /// See the [module-level documentation](index.html) for more. @@ -757,6 +760,9 @@ impl From for RefCell { } } +#[unstable(feature = "coerce_unsized", issue = "27732")] +impl, U> CoerceUnsized> for RefCell {} + struct BorrowRef<'b> { borrow: &'b Cell, } @@ -1086,3 +1092,13 @@ impl From for UnsafeCell { UnsafeCell::new(t) } } + +#[unstable(feature = "coerce_unsized", issue = "27732")] +impl, U> CoerceUnsized> for UnsafeCell {} + +#[allow(unused)] +fn assert_coerce_unsized(a: UnsafeCell<&i32>, b: Cell<&i32>, c: RefCell<&i32>) { + let _: UnsafeCell<&Send> = a; + let _: Cell<&Send> = b; + let _: RefCell<&Send> = c; +}