File tree 1 file changed +16
-0
lines changed
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> {
337
337
}
338
338
}
339
339
340
+ #[ unstable( feature = "coerce_unsized" , issue = "27732" ) ]
341
+ impl < T : CoerceUnsized < U > , U > CoerceUnsized < Cell < U > > for Cell < T > { }
342
+
340
343
/// A mutable memory location with dynamically checked borrow rules
341
344
///
342
345
/// See the [module-level documentation](index.html) for more.
@@ -757,6 +760,9 @@ impl<T> From<T> for RefCell<T> {
757
760
}
758
761
}
759
762
763
+ #[ unstable( feature = "coerce_unsized" , issue = "27732" ) ]
764
+ impl < T : CoerceUnsized < U > , U > CoerceUnsized < RefCell < U > > for RefCell < T > { }
765
+
760
766
struct BorrowRef < ' b > {
761
767
borrow : & ' b Cell < BorrowFlag > ,
762
768
}
@@ -1086,3 +1092,13 @@ impl<T> From<T> for UnsafeCell<T> {
1086
1092
UnsafeCell :: new ( t)
1087
1093
}
1088
1094
}
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