-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bumping a transitive dependency breaks a build #48406
Comments
It happens back to 1.13.0 as well. 1.12.0 fails because of |
A simple case of just a library depending on |
Actually it does as soon as I add the |
OK, this project breaks: [package]
name = "dep-break"
version = "0.1.0"
authors = ["Ben Boeckel <mathstuf@gmail.com>"]
[dependencies]
arrayvec = "~0.3" extern crate arrayvec;
pub fn cmp(p: String, n: &str) -> bool {
n < &p
} Changing it to |
Cc: @bluss |
Bisected to bluss/arrayvec@0c8f467. |
As I noted on the rayon bug, it does work if you explicitly dereference like I guess the most relevant part of that bisected commit is: impl<A: Array<Item=u8>> PartialOrd<ArrayString<A>> for str |
Indeed, commenting out that instance also gets a working build. |
A self-contained reproducer: use std::cmp::Ordering;
struct Foo;
impl PartialEq<Foo> for str {
fn eq(&self, _: &Foo) -> bool {
true
}
}
impl PartialOrd<Foo> for str {
fn partial_cmp(&self, _: &Foo) -> Option<Ordering> {
Some(Ordering::Equal)
}
}
pub fn cmp(p: String, n: &str) -> bool {
n < &p
} |
This |
It seems like the deref coersion is "pushing" from the potential impls of |
When the compiler only finds a single applicable impl, it eagerly selects it, which drives type inference forward. In this case, that infers the right-hand side to be So I think this is just an unpleasant interaction of the above behaviour and the orphan rules, which allow such an impl to be written in the first place (both |
Hmm, OK. We've fixed it by using |
Closing as not-a-bug |
I work on the
git-checks
crate and an update torayon-core:1.4.0
broke the build somehow with this build error:I've set up commits which show the error with just a change in
Cargo.lock
: working build broken build. Why would updatingrayon-core
, a dependency only by transitivity, break the build of thegit-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.
The text was updated successfully, but these errors were encountered: