diff --git a/src/month.rs b/src/month.rs index 146a98ebe5..cc6c617a1f 100644 --- a/src/month.rs +++ b/src/month.rs @@ -31,6 +31,10 @@ use crate::OutOfRange; #[derive(PartialEq, Eq, Copy, Clone, Debug, Hash, PartialOrd, Ord)] #[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] #[cfg_attr(feature = "rkyv", derive(Archive, Deserialize, Serialize))] +#[cfg_attr( + feature = "rkyv", + archive_attr(derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)) +)] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub enum Month { /// January diff --git a/src/naive/date.rs b/src/naive/date.rs index 860593498d..9e6687ffdf 100644 --- a/src/naive/date.rs +++ b/src/naive/date.rs @@ -192,6 +192,10 @@ impl Days { /// [proleptic Gregorian date]: crate::NaiveDate#calendar-date #[derive(PartialEq, Eq, Hash, PartialOrd, Ord, Copy, Clone)] #[cfg_attr(feature = "rkyv", derive(Archive, Deserialize, Serialize))] +#[cfg_attr( + feature = "rkyv", + archive_attr(derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)) +)] pub struct NaiveDate { ymdf: DateImpl, // (year << 13) | of } diff --git a/src/naive/datetime/mod.rs b/src/naive/datetime/mod.rs index 09268aeffd..596c95ca97 100644 --- a/src/naive/datetime/mod.rs +++ b/src/naive/datetime/mod.rs @@ -74,6 +74,10 @@ pub const MAX_DATETIME: NaiveDateTime = NaiveDateTime::MAX; /// ``` #[derive(PartialEq, Eq, Hash, PartialOrd, Ord, Copy, Clone)] #[cfg_attr(feature = "rkyv", derive(Archive, Deserialize, Serialize))] +#[cfg_attr( + feature = "rkyv", + archive_attr(derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)) +)] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub struct NaiveDateTime { date: NaiveDate, diff --git a/src/naive/isoweek.rs b/src/naive/isoweek.rs index 8edf738ba0..deede94d65 100644 --- a/src/naive/isoweek.rs +++ b/src/naive/isoweek.rs @@ -18,6 +18,10 @@ use rkyv::{Archive, Deserialize, Serialize}; /// via the [`Datelike::iso_week`](../trait.Datelike.html#tymethod.iso_week) method. #[derive(PartialEq, Eq, PartialOrd, Ord, Copy, Clone, Hash)] #[cfg_attr(feature = "rkyv", derive(Archive, Deserialize, Serialize))] +#[cfg_attr( + feature = "rkyv", + archive_attr(derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)) +)] pub struct IsoWeek { // note that this allows for larger year range than `NaiveDate`. // this is crucial because we have an edge case for the first and last week supported, diff --git a/src/naive/time/mod.rs b/src/naive/time/mod.rs index 43e614bab0..9bd4a6d5a4 100644 --- a/src/naive/time/mod.rs +++ b/src/naive/time/mod.rs @@ -193,6 +193,10 @@ mod tests; /// **there is absolutely no guarantee that the leap second read has actually happened**. #[derive(PartialEq, Eq, Hash, PartialOrd, Ord, Copy, Clone)] #[cfg_attr(feature = "rkyv", derive(Archive, Deserialize, Serialize))] +#[cfg_attr( + feature = "rkyv", + archive_attr(derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)) +)] pub struct NaiveTime { secs: u32, frac: u32, diff --git a/src/offset/fixed.rs b/src/offset/fixed.rs index 53e734cc16..23acd7b0d8 100644 --- a/src/offset/fixed.rs +++ b/src/offset/fixed.rs @@ -24,6 +24,7 @@ use crate::{DateTime, ParseError, Timelike}; /// [`west_opt`](#method.west_opt) methods for examples. #[derive(PartialEq, Eq, Hash, Copy, Clone)] #[cfg_attr(feature = "rkyv", derive(Archive, Deserialize, Serialize))] +#[cfg_attr(feature = "rkyv", archive_attr(derive(Clone, Copy, PartialEq, Eq, Hash, Debug)))] pub struct FixedOffset { local_minus_utc: i32, } diff --git a/src/offset/local/mod.rs b/src/offset/local/mod.rs index 557f8db03e..ffd2844d55 100644 --- a/src/offset/local/mod.rs +++ b/src/offset/local/mod.rs @@ -105,6 +105,7 @@ mod tz_info; /// ``` #[derive(Copy, Clone, Debug)] #[cfg_attr(feature = "rkyv", derive(Archive, Deserialize, Serialize))] +#[cfg_attr(feature = "rkyv", archive_attr(derive(Clone, Copy, Debug)))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub struct Local; diff --git a/src/offset/utc.rs b/src/offset/utc.rs index d27f7877e1..f50532e0d2 100644 --- a/src/offset/utc.rs +++ b/src/offset/utc.rs @@ -42,6 +42,7 @@ use crate::{Date, DateTime}; /// ``` #[derive(Copy, Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "rkyv", derive(Archive, Deserialize, Serialize))] +#[cfg_attr(feature = "rkyv", archive_attr(derive(Clone, Copy, PartialEq, Eq, Debug, Hash)))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub struct Utc; diff --git a/src/weekday.rs b/src/weekday.rs index a7abd94153..b399748ebf 100644 --- a/src/weekday.rs +++ b/src/weekday.rs @@ -32,6 +32,7 @@ use crate::OutOfRange; #[derive(PartialEq, Eq, Copy, Clone, Debug, Hash)] #[cfg_attr(feature = "rustc-serialize", derive(RustcEncodable, RustcDecodable))] #[cfg_attr(feature = "rkyv", derive(Archive, Deserialize, Serialize))] +#[cfg_attr(feature = "rkyv", archive_attr(derive(Clone, Copy, PartialEq, Eq, Debug, Hash)))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub enum Weekday { /// Monday.