GithubHelp home page GithubHelp logo

Comments (10)

djc avatar djc commented on August 24, 2024

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.

little-dude avatar little-dude commented on August 24, 2024

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.

djc avatar djc commented on August 24, 2024

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.

pitdicker avatar pitdicker commented on August 24, 2024

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.

pitdicker avatar pitdicker commented on August 24, 2024

Reverting the change to Copy is easy, shall I just make a PR?

from chrono.

little-dude avatar little-dude commented on August 24, 2024

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.

djc avatar djc commented on August 24, 2024

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.

little-dude avatar little-dude commented on August 24, 2024

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.

pitdicker avatar pitdicker commented on August 24, 2024

Sorry, I'm not using the right term. Meant 'correct'.

from chrono.

little-dude avatar little-dude commented on August 24, 2024

Thanks for the quick response on this @pitdicker and @djc !

from chrono.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.