chronotope / chrono

Date and time library for Rust
Other
3.3k stars 523 forks source link

Version 0.4.36 has breaking changes with 0.4.35 #1544

Closed Elrendio closed 6 months ago

Elrendio commented 6 months ago

Hello 👋

Chrono-tz doesn't compile after an update of chrono from version 0.4.35 to 0.4.36. Could you please yank the release?

Thanks 🙏

This block of code doesn't compile anymore

use chrono::LocalResult::*;
match (earliest, latest) {
    (result @ Single(_), _) => result,
    (_, result @ Single(_)) => result,
    (Ambiguous(offset, _), _) => Single(offset),
    (_, Ambiguous(offset, _)) => Single(offset),
    (None, None) => None,
}

error[E0432]: unresolved import chrono::LocalResult --> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chrono-tz-0.8.6/src/timezone_impl.rs:318:21 | 318 | use chrono::LocalResult::*; | ^^^^^^^^^^^ LocalResult is a type alias, not a module

Which then creates: error[E0531]: cannot find tuple struct or tuple variant Single in this scope --> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chrono-tz-0.8.6/src/timezone_impl.rs:320:23 320 (result @ Single(), ) => result, ^^^^^^ not found in this scope

help: consider importing this tuple variant | 1 + use chrono::MappedLocalTime::Single;

pitdicker commented 6 months ago

I've yanked the 0.4.36 release for now, and will look into a fix tomorrow.

Rigidity commented 6 months ago

Made me realize I should install things with --locked in our CI workflows 😂 Thanks for fixing so quickly anyways