Skip to content

Fix compilation stability #2610

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

Merged
merged 2 commits into from
Apr 1, 2025
Merged

Fix compilation stability #2610

merged 2 commits into from
Apr 1, 2025

Conversation

rdettai
Copy link
Collaborator

@rdettai rdettai commented Apr 1, 2025

Closes #2607

Compilation started failing on:

let numbers = [100, 200, 300];
let expected_count = numbers.iter().filter(|num| range.contains(num)).count();

num has type &&u64 and this sometime fails to compile with:

no implementation for `&{integer} < u64` and `&{integer} > u64`

(see some tests failure in CI)

Root cause

At least some of the errors are due to an update of an indirect dependency:

│   ├── tantivy-common v0.7.0 (/Users/remi.dettai/tests/tantivy/common)
│   │   └── time v0.3.41
│   │       ├── deranged v0.4.1
│   ├── tantivy-common v0.7.0 (/Users/remi.dettai/workspace/tantivy/common)
│   │   └── time v0.3.37
│   │       ├── deranged v0.3.11

which leads to erros like:

type annotations needed
multiple `impl`s satisfying `u32: PartialEq<_>` found in the following crates: `core`, `deranged`:
- impl PartialEq for u32;
- impl<MIN, MAX> PartialEq<deranged::RangedU32<MIN, MAX>> for u32
  where the constant `MIN` has type `u32`, the constant `MAX` has type `u32`;
required for `Vec<u32>` to implement `PartialEq<Vec<_>>`

@rdettai rdettai requested a review from trinity-1686a April 1, 2025 08:19
@trinity-1686a
Copy link
Contributor

this comes from Deranged adding a impl PartialOrd<u64> for RangedU64<_, _>, which i wouldn't expect to be an issue, but apparently it confuses type resolution in this setup. it seems we are not the only one impacted (rust-lang/rust#138922 jhpratt/deranged#21 ...), though there is little the crate maintainer could have done to prevent this afaict

@trinity-1686a trinity-1686a merged commit 6fc0e96 into main Apr 1, 2025
7 checks passed
@trinity-1686a trinity-1686a deleted the fix-compilation-stability branch April 1, 2025 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"make test" fails with fresh clone
2 participants