Comments (10)
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.
from chrono.
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.
from chrono.
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.
from chrono.
The manual Copy
implementation that was deleted in #1492 was sound, it was only the comment that was incorrect. We had it because the type of Tz
doesn't matter as it isn't a field of the DateTime
struct.
For the Send
implementation I'm not 100% sure it was sound.
from chrono.
Reverting the change to Copy
is easy, shall I just make a PR?
from chrono.
Yeah I agree that the previous Copy
impl was better than the derived one. Wdyt @djc ?
As I understand it, it mostly requires people add bounds that they should have been adding anyway.
Yes, it requires having Tz: Copy, Tz::Offset: Copy
, but since the DateTime
struct looks like this:
pub struct DateTime<Tz: TimeZone> {
datetime: NaiveDateTime,
offset: Tz::Offset,
}
the Tz: Copy
shouldn't be necessary.
from chrono.
Alright, sounds good.
I think the Send
impl was also sound but it was easy to accidentally make it unsound if we changed the layout of NaiveDateTime
.
from chrono.
The manual Copy implementation that was deleted in #1492 was sound, it was only the comment that was incorrect.
OOC how could a Copy
impl be unsound? It isn't an unsafe trait, so I assumed it couldn't be unsound.
from chrono.
Sorry, I'm not using the right term. Meant 'correct'.
from chrono.
Thanks for the quick response on this @pitdicker and @djc !
from chrono.
Related Issues (20)
- How do I get the raw underlying bytes of a `NaiveDate` HOT 4
- Parsing from string to DateTime - input is not enough for unique date and time HOT 3
- TimeDelta always returning a PT in seconds HOT 2
- NaiveDate::years_since wrong documentation
- Saturating operations HOT 9
- Datetime Parse Error when converting rfc2822 date to chrono Datetime HOT 2
- Extra slow Utc to Local conversion HOT 6
- Wasm support for NaiveTime, NaiveDate and alike HOT 2
- Bincode 2.0.0 support HOT 2
- Need Duration to Represent Time in Months/Years HOT 1
- DelayedFormat: Panic in rendering HOT 5
- Err(ParseError(TooShort)) when parsing datetime with trailing 0 HOT 4
- Support for `24:00:00` in `DateTime` Parsing HOT 2
- Century cutoff for %y undocumented
- Add (try_)from_secs_f64, (try_)from_millis_f64, as_millis_f64 and as_secs_f64 to TimeDelta HOT 1
- No serde impls for Months HOT 1
- Integrate with OSS fuzz HOT 1
- FR: support ts_milliseconds for DateTime<Local> HOT 1
- Parsing Bug HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chrono.