-
Notifications
You must be signed in to change notification settings - Fork 542
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
0.4.37 semver-incompatibly removes trait bounds on DateTime
#1571
Comments
Sorry for the regression! We'll look into this. I don't think we're going to just revert the changes for #1492, but let's see what we can do. |
No worries, it's not a big deal for me. I just thought opening an issue might be good if other people run into this. |
Right -- I think I'm inclined to let this one go unless there are multiple reporters for whom it turns out to be a larger problem. As I understand it, it mostly requires people add bounds that they should have been adding anyway. |
DateTime
The manual For the |
Reverting the change to |
Yeah I agree that the previous
Yes, it requires having pub struct DateTime<Tz: TimeZone> {
datetime: NaiveDateTime,
offset: Tz::Offset,
} the |
Alright, sounds good. I think the |
OOC how could a |
Sorry, I'm not using the right term. Meant 'correct'. |
`derive` generates the following impls: ```rust impl<Tz: ::core::marker::Copy + TimeZone> ::core::marker::Copy for DateTime<Tz> where Tz::Offset: ::core::marker::Copy, {} impl<Tz: ::core::clone::Clone + TimeZone> ::core::clone::Clone for DateTime<Tz> where Tz::Offset: ::core::clone::Clone, { #[inline] fn clone(&self) -> DateTime<Tz> { DateTime { datetime: ::core::clone::Clone::clone(&self.datetime), offset: ::core::clone::Clone::clone(&self.offset), } } } ``` In the `Copy` impl, the `Tz: Copy` bound is un-necessary. Note that in the `Clone` impl, he `Tz: Clone` is also un-necessary, but it's implied by the `TimeZone` bound anyway, so there's not point having a manual implementation of `Clone`. Fixes chronotope#1571
Thanks for the quick response on this @pitdicker and @djc ! |
Hello,
The following code compile in 0.4.35 but breaks in 0.4.37:
With 0.4.37:
This is probably due to #1492
The text was updated successfully, but these errors were encountered: