Skip to content

Upgrading chrono 0.3 to 0.4

Breaking0.3.0 → 0.4.45Breaking9Security1Platform4Deprecated14New203Changed47Fixed87Other118

BreakingUpgrade verdict

9 breaking changes and 4 platform requirement changes and a security fix.

  • Drop stabilized feature doc_auto_cfg.
  • Drop deny lints, eager Debug impls are a mixed blessing.
  • Remove obsolete weird feature guard.
  • Remove rustc-serialize feature (.
Top 5 of 28 that need code or config changes

Requires Rust 1.62.0 from 0.4.41 (none stated before).

Breaking9
Drop stabilized feature doc_auto_cfg.
Drop deny lints, eager Debug impls are a mixed blessing.
Remove obsolete weird feature guard.
Remove rustc-serialize feature (.
rustc-serialize
Rename Duration to TimeDelta, add type alias.
DurationTimeDelta
Remove num-iter dependency (.
Drop the dependency on time v0.1, which is deprecated, unless the oldtime feature is active.
oldtimetime::Durationchrono::Duration
Version 0.4.36 introduced an unexpected breaking change and was yanked.
LocalResultMappedLocalTimeResult
format::Numeric and format::Fixed are marked as non_exhaustive.
format::Numericformat::Fixednon_exhaustive
Security1
Potential segfault in localtime_r invocations
Platform4
We had to bump our MSRV to 1.61 to keep building with our dependencies.
DateTime
Bump MSRV to 1.61.
Make methods on NaiveTime const, update MSRV to 1.57 (.
NaiveTime
Bump the MSRV to 1.56.
Deprecated14
Deprecate NaiveDateTime::UNIX_EPOCH.
NaiveDateTime::UNIX_EPOCH
Revert TimeDelta deprecations.
TimeDelta
Deprecate TimeStamp::timestamp_subsec_nanos, which was missed in the 0.4.35 release.
TimeStamp::timestamp_subsec_nanos
We deprecated all timestamp-related methods on NaiveDateTime.
NaiveDateTimeDateTime<Utc>TimeZone.and_utc().naive_utc()
The panicking constructors of TimeDelta (the new name of the Duration type) are deprecated.
TimeDeltaDuration
Deprecate timestamp methods on NaiveDateTime.
NaiveDateTime
Deprecate panicking constructors of TimeDelta.
TimeDelta
Deprecate standalone format functions.
format
Deprecate timestamp_nanos in favor of the non-panicking timestamp_nanos_opt.
timestamp_nanostimestamp_nanos_opt
Deprecate TimeZone::datetime_from_str.
TimeZone::datetime_from_str
Deprecate DateTime::{from_local, from_utc} (.
Deprecate methods that have an _opt() alternative.
_opt()
Deprecate usage of the Date type.
Date<Tz>
More strongly deprecate RustcSerialize: remove it from documentation unless the feature is enabled, issue a deprecation warning if the rustc-serialize feature is enabled (@quodlibetor ).