Closed as not planned
Description
Hi,
After a cargo update
from 0.4.0 to 0.4.1, building unit tests breaks in unrelated parts of my crate (asn1-rs
) due to a conflicting implementation of PartialEq
. Building with 0.4.0 works fine
I know this has already been reported, however I think this is not a duplicate:
- I have updated all dependencies using a global
cargo update
(includingtime
andderanged
), problem is still here cargo outdated
shows to crate to upgrade- this seems to happen only with empty slices
- this happens in code not importing
time
norderanged
I tried to pin the problem to a minimal test case
The errors are related to comparisons of empty &[u8]
(non-empty comparison work). For ex, the following fails:
fn build_failure() {
let b1 = &[0_u8, 1];
assert_eq!(b1, &[]);
}
Edit: the minimal crate I created to show the problem fails for another reason
Edit 2:
I have tried to isolate the problem in a minimal crate here
Adding use time::OffsetDateTime
is enough to trigger the problem:
The first function build_ok builds, while the second fails with error:
error[E0283]: type annotations needed
--> src/lib.rs:10:5
|
10 | assert_eq!(b1, &[]);
| ^^^^^^^^^^^^^^^^^^^ cannot infer type
|
= note: multiple `impl`s satisfying `u8: PartialEq<_>` found in the following crates: `core`, `deranged`:
- impl PartialEq for u8;
- impl<MIN, MAX> PartialEq<deranged::RangedU8<MIN, MAX>> for u8
where the constant `MIN` has type `u8`, the constant `MAX` has type `u8`;
= note: required for `[u8]` to implement `PartialEq<[_; 0]>`
= note: 1 redundant requirement hidden
= note: required for `&[u8]` to implement `PartialEq<&[_; 0]>`
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
Metadata
Metadata
Assignees
Labels
No labels