Skip to content

icu_calendar v2.2 breaks temporal_rs #703

@aapoalas

Description

@aapoalas
error[E0432]: unresolved import `icu_calendar::cal::AnyCalendarDifferenceError`
 --> $PATH/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/temporal_rs-0.2.0/src/error.rs:7:5
  |
7 | use icu_calendar::cal::AnyCalendarDifferenceError;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `AnyCalendarDifferenceError` in `cal`

error[E0432]: unresolved import `icu_calendar::types::DateDurationUnit`
  --> $PATH/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/temporal_rs-0.2.0/src/builtins/core/calendar.rs:33:5
   |
33 |     types::DateDurationUnit as IcuUnit,
   |     ^^^^^^^----------------^^^^^^^^^^^
   |     |      |
   |     |      help: a similar name exists in the module: `DateDuration`
   |     no `DateDurationUnit` in `types`
   |
   = help: consider importing this enum instead:
           icu_calendar::options::DateDurationUnit

   Compiling crossbeam-deque v0.8.6
   Compiling lexical v7.0.5
error[E0599]: no variant or associated item named `Range` found for enum `DateFromFieldsError` in the current scope
   --> $PATH/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/temporal_rs-0.2.0/src/error.rs:280:62
    |
280 |             | Self::Icu4xDateFromFields(DateFromFieldsError::Range(RangeError { field, .. })) => {
    |                                                              ^^^^^ variant or associated item not found in `DateFromFieldsError`

error[E0599]: no variant or associated item named `UnknownEra` found for enum `DateFromFieldsError` in the current scope
   --> $PATH/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/temporal_rs-0.2.0/src/error.rs:289:62
    |
289 |             | Self::Icu4xDateFromFields(DateFromFieldsError::UnknownEra) => "Unknown era.",
    |                                                              ^^^^^^^^^^ variant or associated item not found in `DateFromFieldsError`

error[E0599]: no variant or associated item named `MonthCodeNotInCalendar` found for enum `DateFromFieldsError` in the current scope
   --> $PATH/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/temporal_rs-0.2.0/src/error.rs:294:60
    |
294 |             Self::Icu4xDateFromFields(DateFromFieldsError::MonthCodeNotInCalendar) => {
    |                                                            ^^^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `DateFromFieldsError`
    |
help: there is a variant with a similar name
    |
294 -             Self::Icu4xDateFromFields(DateFromFieldsError::MonthCodeNotInCalendar) => {
294 +             Self::Icu4xDateFromFields(DateFromFieldsError::MonthNotInCalendar) => {
    |

error[E0599]: no variant or associated item named `MonthCodeNotInYear` found for enum `DateFromFieldsError` in the current scope
   --> $PATH/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/temporal_rs-0.2.0/src/error.rs:297:60
    |
297 |             Self::Icu4xDateFromFields(DateFromFieldsError::MonthCodeNotInYear) => {
    |                                                            ^^^^^^^^^^^^^^^^^^ variant or associated item not found in `DateFromFieldsError`
    |
help: there is a variant with a similar name
    |
297 -             Self::Icu4xDateFromFields(DateFromFieldsError::MonthCodeNotInYear) => {
297 +             Self::Icu4xDateFromFields(DateFromFieldsError::MonthNotInYear) => {
    |

   Compiling serde_yml v0.0.12
   Compiling fast-float v0.2.0
error[E0308]: `?` operator has incompatible types
   --> $PATH/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/temporal_rs-0.2.0/src/builtins/core/calendar.rs:475:19
    |
475 |             days: u64::try_from(duration.days.abs()).map_err(|_| invalid)?,
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `u64`
    |
    = note: `?` operator cannot convert from `u64` to `u32`
help: you can convert a `u64` to a `u32` and panic if the converted value doesn't fit
    |
475 |             days: u64::try_from(duration.days.abs()).map_err(|_| invalid)?.try_into().unwrap(),
    |                                                                           ++++++++++++++++++++

error[E0277]: the trait bound `DateDurationUnit: TryFrom<Unit>` is not satisfied
   --> $PATH/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/temporal_rs-0.2.0/src/builtins/core/calendar.rs:507:50
    |
507 |         options.largest_unit = Some(largest_unit.try_into()?);
    |                                                  ^^^^^^^^ the trait `From<Unit>` is not implemented for `DateDurationUnit`
    |
    = note: required for `Unit` to implement `Into<DateDurationUnit>`
    = note: required for `DateDurationUnit` to implement `TryFrom<Unit>`
    = note: required for `Unit` to implement `TryInto<DateDurationUnit>`

error[E0277]: the `?` operator can only be applied to values that implement `Try`
   --> $PATH/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/temporal_rs-0.2.0/src/builtins/core/calendar.rs:511:21
    |
511 |         let added = self.0.until(&calendar_date1, &calendar_date2, options)?;
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `icu_calendar::types::DateDuration`
    |
    = help: the trait `Try` is not implemented for `icu_calendar::types::DateDuration`

Not really temporal's fault but worth noting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions