File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -337,6 +337,9 @@ impl<T: Copy> From<T> for Cell<T> {
337337 }
338338}
339339
340+ #[ unstable( feature = "coerce_unsized" , issue = "27732" ) ]
341+ impl < T : CoerceUnsized < U > , U > CoerceUnsized < Cell < U > > for Cell < T > { }
342+
340343/// A mutable memory location with dynamically checked borrow rules
341344///
342345/// See the [module-level documentation](index.html) for more.
@@ -757,6 +760,9 @@ impl<T> From<T> for RefCell<T> {
757760 }
758761}
759762
763+ #[ unstable( feature = "coerce_unsized" , issue = "27732" ) ]
764+ impl < T : CoerceUnsized < U > , U > CoerceUnsized < RefCell < U > > for RefCell < T > { }
765+
760766struct BorrowRef < ' b > {
761767 borrow : & ' b Cell < BorrowFlag > ,
762768}
@@ -1086,3 +1092,13 @@ impl<T> From<T> for UnsafeCell<T> {
10861092 UnsafeCell :: new ( t)
10871093 }
10881094}
1095+
1096+ #[ unstable( feature = "coerce_unsized" , issue = "27732" ) ]
1097+ impl < T : CoerceUnsized < U > , U > CoerceUnsized < UnsafeCell < U > > for UnsafeCell < T > { }
1098+
1099+ #[ allow( unused) ]
1100+ fn assert_coerce_unsized ( a : UnsafeCell < & i32 > , b : Cell < & i32 > , c : RefCell < & i32 > ) {
1101+ let _: UnsafeCell < & Send > = a;
1102+ let _: Cell < & Send > = b;
1103+ let _: RefCell < & Send > = c;
1104+ }
You can’t perform that action at this time.
0 commit comments