-
Notifications
You must be signed in to change notification settings - Fork 557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove unnessary Copy and Send impls #1492
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1492 +/- ##
=======================================
Coverage 91.80% 91.80%
=======================================
Files 40 40
Lines 18329 18336 +7
=======================================
+ Hits 16827 16834 +7
Misses 1502 1502 ☔ View full report in Codecov by Sentry. |
Fuchsia is doing an audit of chrono 0.4.34, and we noticed an unncessary unsafe of `Send` for `DateTime`. While it's valid since `Tz::Offset` is `Send`, and `NaiveDateTime` only has `u32` fields, there's a potential hazard if `NaiveDateTime` ever grows unsendable fields (unlikely as that is). This (and the `Copy` impl) were added 9 years ago to fix chronotope#25, which stemmed from early versions of associate traits not working properly with auto-traits. This has since been fixed, and is no longer necessary with the MSRV 1.61.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
@@ -1866,3 +1866,12 @@ fn nano_roundrip() { | |||
assert_eq!(nanos, nanos2); | |||
} | |||
} | |||
|
|||
#[test] | |||
fn test_datetime_utc_is_copy_and_send() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have the same test ca. 600 lines above.
Removing the duplicate test in #1494. |
Fuchsia is doing an audit of chrono 0.4.34, and we noticed an unncessary unsafe of
Send
forDateTime
. While it's valid sinceTz::Offset
isSend
, andNaiveDateTime
only hasu32
fields, there's a potential hazard ifNaiveDateTime
ever grows unsendable fields (unlikely as that is).This (and the
Copy
impl) were added 9 years ago to fix #25, which stemmed from early versions of associate traits not working properly with auto-traits. This has since been fixed, and is no longer necessary with the MSRV 1.61.0.To make sure this stays working, it includes a test that makes sure that
DateTime<Utc>
isSend
andCopy
just to be safe.