Skip to content

jiff range int trait impls introduce a bunch of ambiguity for Into::into #293

@khuey

Description

@khuey

After upgrading a project from env_logger 0.11.6 (which uses humantime) to env_logger 0.11.7 (which uses jiff 0.2) I get a bunch of errors like this:

 error[E0283]: type annotations needed
    --> data-rewriter/src/rust_std.rs:1222:40
     |
1222 |                 assert!(index < length.into());
     |                               -        ^^^^
     |                               |
     |                               type must be known at this point
     |
     = note: multiple `impl`s satisfying `i128: PartialOrd<_>` found in the following crates: `core`, `jiff`:
             - impl PartialOrd for i128;
             - impl<MIN, MAX> PartialOrd<jiff::util::rangeint::ri128<MIN, MAX>> for i128
               where the constant `MIN` has type `i128`, the constant `MAX` has type `i128`;
help: try using a fully qualified path to specify the expected types
     |
1222 |                 assert!(index < <u64 as Into<T>>::into(length));
     |                                 +++++++++++++++++++++++      

(where index is i128 and length is u64).

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions