252252
253253use crate :: cmp:: Ordering ;
254254use crate :: fmt:: { self , Debug , Display } ;
255- use crate :: marker:: { PhantomData , Unsize } ;
255+ use crate :: marker:: { Move , PhantomData , Unsize } ;
256256use crate :: mem;
257257use crate :: ops:: { CoerceUnsized , Deref , DerefMut , DerefPure , DispatchFromDyn } ;
258258use crate :: panic:: const_panic;
@@ -309,7 +309,7 @@ pub use once::OnceCell;
309309#[ stable( feature = "rust1" , since = "1.0.0" ) ]
310310#[ repr( transparent) ]
311311#[ rustc_pub_transparent]
312- pub struct Cell < T : ?Sized > {
312+ pub struct Cell < T : ?Sized + ? Move > {
313313 value : UnsafeCell < T > ,
314314}
315315
@@ -322,7 +322,7 @@ unsafe impl<T: ?Sized> Send for Cell<T> where T: Send {}
322322// having an explicit negative impl is nice for documentation purposes
323323// and results in nicer error messages.
324324#[ stable( feature = "rust1" , since = "1.0.0" ) ]
325- impl < T : ?Sized > !Sync for Cell < T > { }
325+ impl < T : ?Sized + ? Move > !Sync for Cell < T > { }
326326
327327#[ stable( feature = "rust1" , since = "1.0.0" ) ]
328328impl < T : Copy > Clone for Cell < T > {
@@ -669,7 +669,7 @@ impl<T: CoerceUnsized<U>, U> CoerceUnsized<Cell<U>> for Cell<T> {}
669669// `self: Cell<&Self>` won't work
670670// `self: CellWrapper<Self>` becomes possible
671671#[ 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 > { }
673673
674674impl < T > Cell < [ T ] > {
675675 /// Returns a `&[Cell<T>]` from a `&Cell<[T]>`
@@ -2185,12 +2185,12 @@ impl<T: ?Sized + fmt::Display> fmt::Display for RefMut<'_, T> {
21852185#[ stable( feature = "rust1" , since = "1.0.0" ) ]
21862186#[ repr( transparent) ]
21872187#[ rustc_pub_transparent]
2188- pub struct UnsafeCell < T : ?Sized > {
2188+ pub struct UnsafeCell < T : ?Sized + ? Move > {
21892189 value : T ,
21902190}
21912191
21922192#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2193- impl < T : ?Sized > !Sync for UnsafeCell < T > { }
2193+ impl < T : ?Sized + ? Move > !Sync for UnsafeCell < T > { }
21942194
21952195impl < T > UnsafeCell < T > {
21962196 /// 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> {}
24552455// `self: UnsafeCell<&Self>` won't work
24562456// `self: UnsafeCellWrapper<Self>` becomes possible
24572457#[ 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 > { }
24592459
24602460/// [`UnsafeCell`], but [`Sync`].
24612461///
@@ -2473,7 +2473,7 @@ impl<T: DispatchFromDyn<U>, U> DispatchFromDyn<UnsafeCell<U>> for UnsafeCell<T>
24732473#[ repr( transparent) ]
24742474#[ rustc_diagnostic_item = "SyncUnsafeCell" ]
24752475#[ rustc_pub_transparent]
2476- pub struct SyncUnsafeCell < T : ?Sized > {
2476+ pub struct SyncUnsafeCell < T : ?Sized + ? Move > {
24772477 value : UnsafeCell < T > ,
24782478}
24792479
@@ -2563,7 +2563,10 @@ impl<T: CoerceUnsized<U>, U> CoerceUnsized<SyncUnsafeCell<U>> for SyncUnsafeCell
25632563// `self: SyncUnsafeCellWrapper<Self>` becomes possible
25642564#[ unstable ( feature = "dispatch_from_dyn" , issue = "none" ) ]
25652565//#[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+ }
25672570
25682571#[ allow ( unused ) ]
25692572fn assert_coerce_unsized (
0 commit comments