chronotope / chrono-tz

TimeZone implementations for rust-chrono from the IANA database
Other
235 stars 56 forks source link

Chrono-tz v0.8.4 does not work with chrono <= v0.4.23 #142

Closed morbatex closed 11 months ago

morbatex commented 11 months ago

Chrono-tz v0.8.4 does use NaiveTime::MIN of chrono, which is only public since v0.4.24. As chrone-tz does only require chrono v0.4 in it's Cargo.toml it is possible, that a user uses a chrono version <= 0.4.23, which will lead to build errors.

How to reproduce

Expected behaviour

Everything should build

Current behaviour

Chrono-tz build fails with the following error:

error[E0624]: associated constant `MIN` is private
   --> /home/morbatex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chrono-tz-0.8.4/src/timezone_impl.rs:289:83
    |
289 |         let earliest = self.offset_from_local_datetime(&local.and_time(NaiveTime::MIN));
    |                                                                                   ^^^ private associated constant
    |
   ::: /home/morbatex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chrono-0.4.23/src/naive/time/mod.rs:755:5
    |
755 |     pub(super) const MIN: Self = Self { secs: 0, frac: 0 };
    |     -------------------------- private associated constant defined here

error[E0624]: associated constant `MIN` is private
   --> /home/morbatex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chrono-tz-0.8.4/src/timezone_impl.rs:358:64
    |
358 |         self.offset_from_utc_datetime(&utc.and_time(NaiveTime::MIN))
    |                                                                ^^^ private associated constant
    |
   ::: /home/morbatex/.cargo/registry/src/index.crates.io-6f17d22bba15001f/chrono-0.4.23/src/naive/time/mod.rs:755:5
    |
755 |     pub(super) const MIN: Self = Self { secs: 0, frac: 0 };
    |     -------------------------- private associated constant defined here

For more information about this error, try `rustc --explain E0624`.
error: could not compile `chrono-tz` (lib) due to 2 previous errors