Skip to content

Compilation error: ambiguous quarter() method call in temporal.rs with chrono 0.4.41 #8221

@DataBora

Description

@DataBora

Compilation fails when using arrow-arith with chrono 0.4.41 due to ambiguous method resolution for quarter() in temporal.rs.

To Reproduce

  1. Use arrow-arith 53.4.0 or later
  2. With chrono 0.4.41
  3. Compilation fails with trait ambiguity error

Error message
error[E0034]: multiple applicable items in scope
--> arrow-arith-53.4.0/src/temporal.rs:91:36
|
91 | DatePart::Quarter => |d| d.quarter() as i32,
| ^^^^^^^ multiple quarter found
|
note: candidate #1 is defined in the trait ChronoDateExt
note: candidate #2 is defined in the trait Datelike

Expected behavior
Code should compile without ambiguity errors.

Proposing solution
Disambiguate the method call on line 91 in temporal.rs file:

DatePart::Quarter => |d| Datelike::quarter(&d) as i32,

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions