252
252
253
253
use crate :: cmp:: Ordering ;
254
254
use crate :: fmt:: { self , Debug , Display } ;
255
- use crate :: marker:: { PhantomData , Unsize } ;
255
+ use crate :: marker:: { Move , PhantomData , Unsize } ;
256
256
use crate :: mem;
257
257
use crate :: ops:: { CoerceUnsized , Deref , DerefMut , DerefPure , DispatchFromDyn } ;
258
258
use crate :: panic:: const_panic;
@@ -309,7 +309,7 @@ pub use once::OnceCell;
309
309
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
310
310
#[ repr( transparent) ]
311
311
#[ rustc_pub_transparent]
312
- pub struct Cell < T : ?Sized > {
312
+ pub struct Cell < T : ?Sized + ? Move > {
313
313
value : UnsafeCell < T > ,
314
314
}
315
315
@@ -322,7 +322,7 @@ unsafe impl<T: ?Sized> Send for Cell<T> where T: Send {}
322
322
// having an explicit negative impl is nice for documentation purposes
323
323
// and results in nicer error messages.
324
324
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
325
- impl < T : ?Sized > !Sync for Cell < T > { }
325
+ impl < T : ?Sized + ? Move > !Sync for Cell < T > { }
326
326
327
327
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
328
328
impl < T : Copy > Clone for Cell < T > {
@@ -669,7 +669,7 @@ impl<T: CoerceUnsized<U>, U> CoerceUnsized<Cell<U>> for Cell<T> {}
669
669
// `self: Cell<&Self>` won't work
670
670
// `self: CellWrapper<Self>` becomes possible
671
671
#[ unstable( feature = "dispatch_from_dyn" , issue = "none" ) ]
672
- impl < T : DispatchFromDyn < U > , U > DispatchFromDyn < Cell < U > > for Cell < T > { }
672
+ impl < T : DispatchFromDyn < U > + ? Move , U : ? Move > DispatchFromDyn < Cell < U > > for Cell < T > { }
673
673
674
674
impl < T > Cell < [ T ] > {
675
675
/// Returns a `&[Cell<T>]` from a `&Cell<[T]>`
@@ -2185,12 +2185,12 @@ impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
2185
2185
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2186
2186
#[ repr( transparent) ]
2187
2187
#[ rustc_pub_transparent]
2188
- pub struct UnsafeCell < T : ?Sized > {
2188
+ pub struct UnsafeCell < T : ?Sized + ? Move > {
2189
2189
value : T ,
2190
2190
}
2191
2191
2192
2192
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2193
- impl < T : ?Sized > !Sync for UnsafeCell < T > { }
2193
+ impl < T : ?Sized + ? Move > !Sync for UnsafeCell < T > { }
2194
2194
2195
2195
impl < T > UnsafeCell < T > {
2196
2196
/// Constructs a new instance of `UnsafeCell` which will wrap the specified
@@ -2455,7 +2455,7 @@ impl<T: CoerceUnsized<U>, U> CoerceUnsized<UnsafeCell<U>> for UnsafeCell<T> {}
2455
2455
// `self: UnsafeCell<&Self>` won't work
2456
2456
// `self: UnsafeCellWrapper<Self>` becomes possible
2457
2457
#[ unstable( feature = "dispatch_from_dyn" , issue = "none" ) ]
2458
- impl <T : DispatchFromDyn < U > , U > DispatchFromDyn < UnsafeCell < U > > for UnsafeCell < T > { }
2458
+ impl <T : DispatchFromDyn < U > + ? Move , U : ? Move > DispatchFromDyn < UnsafeCell < U > > for UnsafeCell < T > { }
2459
2459
2460
2460
/// [`UnsafeCell`], but [`Sync`].
2461
2461
///
@@ -2473,7 +2473,7 @@ impl<T: DispatchFromDyn<U>, U> DispatchFromDyn<UnsafeCell<U>> for UnsafeCell<T>
2473
2473
#[ repr( transparent) ]
2474
2474
#[ rustc_diagnostic_item = "SyncUnsafeCell" ]
2475
2475
#[ rustc_pub_transparent]
2476
- pub struct SyncUnsafeCell < T : ?Sized > {
2476
+ pub struct SyncUnsafeCell < T : ?Sized + ? Move > {
2477
2477
value : UnsafeCell < T > ,
2478
2478
}
2479
2479
@@ -2563,7 +2563,10 @@ impl<T: CoerceUnsized<U>, U> CoerceUnsized<SyncUnsafeCell<U>> for SyncUnsafeCell
2563
2563
// `self: SyncUnsafeCellWrapper<Self>` becomes possible
2564
2564
#[ unstable ( feature = "dispatch_from_dyn" , issue = "none" ) ]
2565
2565
//#[unstable(feature = "sync_unsafe_cell", issue = "95439")]
2566
- impl <T : DispatchFromDyn < U > , U > DispatchFromDyn < SyncUnsafeCell < U > > for SyncUnsafeCell < T > { }
2566
+ impl <T : DispatchFromDyn < U > + ?Move , U : ?Move > DispatchFromDyn < SyncUnsafeCell < U > >
2567
+ for SyncUnsafeCell < T >
2568
+ {
2569
+ }
2567
2570
2568
2571
#[ allow ( unused ) ]
2569
2572
fn assert_coerce_unsized (
0 commit comments