X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibcore%2Fcell.rs;h=2af48ef2fabe3b42d04cfa53bb4bd565259f538b;hb=43204fff5d0a656f8a94bfff3129e04bc9d30ad4;hp=a388012e1daf2cd80e69ed5b5bf5576949230206;hpb=cc431a017d5c35e1376a33fb443c12e21d1139cc;p=rust.git diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index a388012e1da..2af48ef2fab 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -355,6 +355,9 @@ fn from(t: T) -> 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. @@ -793,6 +796,9 @@ fn from(t: T) -> RefCell { } } +#[unstable(feature = "coerce_unsized", issue = "27732")] +impl, U> CoerceUnsized> for RefCell {} + struct BorrowRef<'b> { borrow: &'b Cell, } @@ -1122,3 +1128,13 @@ fn from(t: T) -> 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; +}