Skip to content

Bumping a transitive dependency breaks a build #48406

Closed
@mathstuf

Description

@mathstuf

I work on the git-checks crate and an update to rayon-core:1.4.0 broke the build somehow with this build error:

error[E0277]: the trait bound `str: std::cmp::PartialOrd<std::string::String>` is not satisfied
  --> src/checks/lfs_pointer.rs:32:27
   |
32 |             } else if key < &old_key {
   |                           ^ can't compare `str` with `std::string::String`
   |
   = help: the trait `std::cmp::PartialOrd<std::string::String>` is not implemented for `str`
   = note: required because of the requirements on the impl of `std::cmp::PartialOrd<&std::string::String>` for `&str`

I've set up commits which show the error with just a change in Cargo.lock: working build broken build. Why would updating rayon-core, a dependency only by transitivity, break the build of the git-checks crate?

This happens when using any compiler from 1.17.0 (the minimum Rust version of git-checks) through nightly. I'll try and push back to older Rust versions to see if this worked before.

Originally filed in rayon-rs/rayon#542.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-coercionsArea: implicit and explicit `expr as Type` coercionsC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions