Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: BurntSushi/jiff
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: jiff-static-0.2.3
Choose a base ref
...
head repository: BurntSushi/jiff
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.2.4
Choose a head ref
  • 4 commits
  • 26 files changed
  • 1 contributor

Commits on Mar 7, 2025

  1. tz: fix comment and remove superfluous repr(align(..))

    When I originally wrote the comment on `Repr`, I got the alignment
    wrong. But I caught that mistake and fixed it before merging anything
    to `master`. I just hadn't updated the comment.
    
    The `repr(align(..))` was leftovers from experimenting with a
    `TzifDateTime` that *wasn't* packed. I was trying to get `rustc` to
    optimize comparisons automatically to a single integer, but couldn't get
    ti to work. So I resorted to bit-packing. Since the representation is
    now just an `i64`, an explicit alignment is not needed. (And it didn't
    help anyway.)
    BurntSushi committed Mar 7, 2025
    Configuration menu
    Copy the full SHA
    460a0bc View commit details
    Browse the repository at this point in the history

Commits on Mar 10, 2025

  1. jiff-static: improve README

    This was still the copy from `jiff-tzdb`. Update it to be about
    `jiff-static`.
    BurntSushi committed Mar 10, 2025
    Configuration menu
    Copy the full SHA
    0a0b5a0 View commit details
    Browse the repository at this point in the history
  2. rangeint: remove PartialEq and PartialOrd impls for i{8,16,32,64,128}

    Unfortunately, these impls can cause inference regressions when
    non-robust code is written that assumes there is only one
    Partial{Eq,Ord} impl for a particular integer type.
    
    It would be one thing if these trait impls were external or somehow
    fundamental to Jiff's design. But they only existed as a convenience. So
    we remove the trait impls and take our medicine. We already had a
    `Constant` wrapper type (also used for trait impls), so we just switch
    all equality and inequality comparisons over to that.
    
    I tested this with the following program:
    
    ```rust
    use env_logger;
    
    fn main() {
        let x: u64 = 1;
        let y: i128 = 0;
        assert!(y < x.into());
    
        let x: u32 = 1;
        let y: i64 = 0;
        assert!(y < x.into());
    
        let x: u16 = 1;
        let y: i32 = 0;
        assert!(y < x.into());
    
        let x: u8 = 1;
        let y: i16 = 0;
        assert!(y < x.into());
    }
    ```
    
    And this `Cargo.toml`:
    
    ```toml
    [package]
    publish = false
    name = "jiff-inference-regression"
    version = "0.1.0"
    edition = "2024"
    
    [patch.crates-io]
    jiff = { path = "/home/andrew/rust/jiff/fixit" }
    
    [dependencies]
    env_logger = { version = "0.11.7", features = ["humantime"] }
    
    [[bin]]
    name = "jiff-inference-regression"
    path = "main.rs"
    
    [profile.release]
    debug = true
    ```
    
    I took this path because it's either this or the reporter fixes their
    code. Arguably, the reporter should fix their code since it's likely
    their code will break when or if some other crate adds similar trait
    impls. But as I said, these trait impls are just for convenience, so
    the pragmatic trade-off is to remove them and thus not be the source of
    whatever problems folks hit.
    
    [I asked the lang team about this problem][lang-zulip-question], and
    they seem to agree that this is the right course of action. (And there
    are ideas swirling around on how to mitigate this problem, but that's
    for the future.)
    
    Fixes #293
    
    [lang-zulip-question]: https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/about.20the.20breakage.20that.20results.20from.20relying.20on.20inference/with/504689811
    BurntSushi committed Mar 10, 2025
    Configuration menu
    Copy the full SHA
    b9119a3 View commit details
    Browse the repository at this point in the history
  3. 0.2.4

    BurntSushi committed Mar 10, 2025
    Configuration menu
    Copy the full SHA
    4404fb0 View commit details
    Browse the repository at this point in the history
Loading