Diffstat (limited to 'src/any/static_wrapper.rs')
| -rw-r--r-- | src/any/static_wrapper.rs | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/any/static_wrapper.rs b/src/any/static_wrapper.rs index 58d101b..3d9d057 100644 --- a/src/any/static_wrapper.rs +++ b/src/any/static_wrapper.rs @@ -12,16 +12,17 @@ pub struct OwnedStatic<T: ?Sized>(pub T); higher_ranked_type! { impl TypeName { impl['a, 'ctx, T] type T['a, 'ctx] for OwnedStatic<T> = OwnedStatic<T> where { - T: ?Sized + 'static + T: ?Sized + Send + Sync + 'static }; impl['a, 'ctx, T] type HigherRanked['a, 'ctx] for OwnedStatic<T> = OwnedStatic<T> where { - T: ?Sized + 'static + T: ?Sized + Send + Sync + 'static }; } } /// Borrowed static `T` for `'ctx`. +#[derive(PartialEq, Clone, Copy, Debug)] #[repr(transparent)] pub struct BorrowedStatic<'ctx, T: ?Sized>(pub &'ctx T); @@ -30,16 +31,17 @@ pub struct BorrowedStaticHrt<T: ?Sized>(Marker<T>); higher_ranked_type! { impl TypeName { impl['a, 'ctx, T] type T['a, 'ctx] for BorrowedStaticHrt<T> = BorrowedStatic<'ctx, T> where { - T: ?Sized + 'static + T: ?Sized + Send + Sync + 'static }; impl['a, 'ctx, T] type HigherRanked['a, 'ctx] for BorrowedStatic<'ctx, T> = BorrowedStaticHrt<T> where { - T: ?Sized + 'static + T: ?Sized + Send + Sync + 'static }; } } /// Borrowed static `T` for `'a`. +#[derive(PartialEq, Clone, Copy, Debug)] #[repr(transparent)] pub struct TempBorrowedStatic<'a, T: ?Sized>(pub &'a T); @@ -48,16 +50,17 @@ pub struct TempBorrowedStaticHrt<T: ?Sized>(Marker<T>); higher_ranked_type! { impl TypeName { impl['a, 'ctx, T] type T['a, 'ctx] for TempBorrowedStaticHrt<T> = TempBorrowedStatic<'a, T> where { - T: ?Sized + 'static + T: ?Sized + Send + Sync + 'static }; impl['a, 'ctx, T] type HigherRanked['a, 'ctx] for TempBorrowedStatic<'a, T> = TempBorrowedStaticHrt<T> where { - T: ?Sized + 'static + T: ?Sized + Send + Sync + 'static }; } } /// Mutably borrowed static `T` for `'ctx`. +#[derive(PartialEq, Debug)] #[repr(transparent)] pub struct BorrowedMutStatic<'ctx, T: ?Sized>(pub &'ctx mut T); @@ -66,16 +69,17 @@ pub struct BorrowedMutStaticHrt<T: ?Sized>(Marker<T>); higher_ranked_type! { impl TypeName { impl['a, 'ctx, T] type T['a, 'ctx] for BorrowedMutStaticHrt<T> = BorrowedMutStatic<'ctx, T> where { - T: ?Sized + 'static + T: ?Sized + Send + Sync + 'static }; impl['a, 'ctx, T] type HigherRanked['a, 'ctx] for BorrowedMutStatic<'ctx, T> = BorrowedMutStaticHrt<T> where { - T: ?Sized + 'static + T: ?Sized + Send + Sync + 'static }; } } /// Mutably borrowed static `T` for `'a`. +#[derive(PartialEq, Debug)] #[repr(transparent)] pub struct TempBorrowedMutStatic<'a, T: ?Sized>(pub &'a mut T); @@ -84,11 +88,11 @@ pub struct TempBorrowedMutStaticHrt<T: ?Sized>(Marker<T>); higher_ranked_type! { impl TypeName { impl['a, 'ctx, T] type T['a, 'ctx] for TempBorrowedMutStaticHrt<T> = TempBorrowedMutStatic<'a, T> where { - T: ?Sized + 'static + T: ?Sized + Send + Sync + 'static }; impl['a, 'ctx, T] type HigherRanked['a, 'ctx] for TempBorrowedMutStatic<'a, T> = TempBorrowedMutStaticHrt<T> where { - T: ?Sized + 'static + T: ?Sized + Send + Sync + 'static }; } } @@ -102,11 +106,11 @@ pub struct BoxedStatic<T: ?Sized>(pub Box<T>); higher_ranked_type! { impl TypeName { impl['a, 'ctx, T] type T['a, 'ctx] for BoxedStatic<T> = BoxedStatic<T> where { - T: ?Sized + 'static + T: ?Sized + Send + Sync + 'static }; impl['a, 'ctx, T] type HigherRanked['a, 'ctx] for BoxedStatic<T> = BoxedStatic<T> where { - T: ?Sized + 'static + T: ?Sized + Send + Sync + 'static }; } } |