@@ -3684,7 +3684,6 @@ fn data_offset_align(align: usize) -> usize {
3684
3684
/// previous example, `UniqueRc` allows for more flexibility in the construction of cyclic data,
3685
3685
/// including fallible or async constructors.
3686
3686
#[ unstable( feature = "unique_rc_arc" , issue = "112566" ) ]
3687
- #[ derive( Debug ) ]
3688
3687
pub struct UniqueRc <
3689
3688
T : ?Sized ,
3690
3689
#[ unstable( feature = "allocator_api" , issue = "32838" ) ] A : Allocator = Global ,
@@ -3694,12 +3693,80 @@ pub struct UniqueRc<
3694
3693
alloc : A ,
3695
3694
}
3696
3695
3696
+ // Not necessary for correctness since `UniqueRc` contains `NonNull`,
3697
+ // but having an explicit negative impl is nice for documentation purposes
3698
+ // and results in nicer error messages.
3699
+ #[ unstable( feature = "unique_rc_arc" , issue = "112566" ) ]
3700
+ impl < T : ?Sized , A : Allocator > !Send for UniqueRc < T , A > { }
3701
+
3702
+ // Not necessary for correctness since `UniqueRc` contains `NonNull`,
3703
+ // but having an explicit negative impl is nice for documentation purposes
3704
+ // and results in nicer error messages.
3705
+ #[ unstable( feature = "unique_rc_arc" , issue = "112566" ) ]
3706
+ impl < T : ?Sized , A : Allocator > !Sync for UniqueRc < T , A > { }
3707
+
3697
3708
#[ unstable( feature = "unique_rc_arc" , issue = "112566" ) ]
3698
3709
impl < T : ?Sized + Unsize < U > , U : ?Sized , A : Allocator > CoerceUnsized < UniqueRc < U , A > >
3699
3710
for UniqueRc < T , A >
3700
3711
{
3701
3712
}
3702
3713
3714
+ //#[unstable(feature = "unique_rc_arc", issue = "112566")]
3715
+ #[ unstable( feature = "dispatch_from_dyn" , issue = "none" ) ]
3716
+ impl < T : ?Sized + Unsize < U > , U : ?Sized > DispatchFromDyn < UniqueRc < U > > for UniqueRc < T > { }
3717
+
3718
+ #[ unstable( feature = "unique_rc_arc" , issue = "112566" ) ]
3719
+ impl < T : ?Sized + fmt:: Display , A : Allocator > fmt:: Display for UniqueRc < T , A > {
3720
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
3721
+ fmt:: Display :: fmt ( & * * self , f)
3722
+ }
3723
+ }
3724
+
3725
+ #[ unstable( feature = "unique_rc_arc" , issue = "112566" ) ]
3726
+ impl < T : ?Sized + fmt:: Debug , A : Allocator > fmt:: Debug for UniqueRc < T , A > {
3727
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
3728
+ fmt:: Debug :: fmt ( & * * self , f)
3729
+ }
3730
+ }
3731
+
3732
+ #[ unstable( feature = "unique_rc_arc" , issue = "112566" ) ]
3733
+ impl < T : ?Sized , A : Allocator > fmt:: Pointer for UniqueRc < T , A > {
3734
+ fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
3735
+ fmt:: Pointer :: fmt ( & ( & raw const * * self ) , f)
3736
+ }
3737
+ }
3738
+
3739
+ #[ unstable( feature = "unique_rc_arc" , issue = "112566" ) ]
3740
+ impl < T : ?Sized , A : Allocator > borrow:: Borrow < T > for UniqueRc < T , A > {
3741
+ fn borrow ( & self ) -> & T {
3742
+ & * * self
3743
+ }
3744
+ }
3745
+
3746
+ #[ unstable( feature = "unique_rc_arc" , issue = "112566" ) ]
3747
+ impl < T : ?Sized , A : Allocator > borrow:: BorrowMut < T > for UniqueRc < T , A > {
3748
+ fn borrow_mut ( & mut self ) -> & mut T {
3749
+ & mut * * self
3750
+ }
3751
+ }
3752
+
3753
+ #[ unstable( feature = "unique_rc_arc" , issue = "112566" ) ]
3754
+ impl < T : ?Sized , A : Allocator > AsRef < T > for UniqueRc < T , A > {
3755
+ fn as_ref ( & self ) -> & T {
3756
+ & * * self
3757
+ }
3758
+ }
3759
+
3760
+ #[ unstable( feature = "unique_rc_arc" , issue = "112566" ) ]
3761
+ impl < T : ?Sized , A : Allocator > AsMut < T > for UniqueRc < T , A > {
3762
+ fn as_mut ( & mut self ) -> & mut T {
3763
+ & mut * * self
3764
+ }
3765
+ }
3766
+
3767
+ #[ unstable( feature = "unique_rc_arc" , issue = "112566" ) ]
3768
+ impl < T : ?Sized , A : Allocator > Unpin for UniqueRc < T , A > { }
3769
+
3703
3770
// Depends on A = Global
3704
3771
impl < T > UniqueRc < T > {
3705
3772
/// Creates a new `UniqueRc`.
0 commit comments