Skip to content

Compilation error due to rkyv/rkyv#434 #14862

@ryzhyk

Description

@ryzhyk

Describe the bug

When datafusion is used in a workspace that enables the rkyv-64 feature in the chrono crate, this triggers a Rust compilation error:

error[E0277]: can't compare `Option<&std::string::String>` with `Option<&mut std::string::String>`
    --> datafusion/expr/src/logical_plan/plan.rs:2872:43
     |
2872 |         merged.retain(|k, v| input.get(k) == Some(v));
     |                                           ^^ no implementation for `Option<&std::string::String> == Option<&mut std::string::String>`
     |
     = help: the trait `PartialEq<Option<&mut std::string::String>>` is not implemented for `Option<&std::string::String>`
     = help: the following other types implement trait `PartialEq<Rhs>`:
               `Option<T>` implements `PartialEq`
               `Option<U>` implements `PartialEq<rkyv::option::ArchivedOption<T>>`

The root cause of the error is incorrect type unification in the Rust compiler, as explained in rkyv/rkyv#434.

I will submit a PR with a workaround.

To Reproduce

Change Cargo.toml to enable the rkyv-64 feature in chrono and try building the datafusion-expr crate:

chrono = { version = "0.4.38", default-features = false, features = ["rkyv-64"] }

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions