Skip to content

Type annotations needed encountered when cargo install on macOS #7550

@AspadaX

Description

@AspadaX

My Rust compiler is 1.85:

error[E0283]: type annotations needed
    --> /Users/xinyubao/.cargo/registry/src/rsproxy.cn-e3de039b2554c837/uu_ls-0.0.30/src/ls.rs:3271:87
     |
3271 |         |namelen: usize| config.width != 0 && current_column + namelen > config.width.into();
     |                                                                        -              ^^^^
     |                                                                        |
     |                                                                        type must be known at this point
     |
     = note: multiple `impl`s satisfying `usize: PartialOrd<_>` found in the following crates: `core`, `deranged`:
             - impl PartialOrd for usize;
             - impl<MIN, MAX> PartialOrd<deranged::RangedUsize<MIN, MAX>> for usize
               where the constant `MIN` has type `usize`, the constant `MAX` has type `usize`;
help: try using a fully qualified path to specify the expected types
     |
3271 |         |namelen: usize| config.width != 0 && current_column + namelen > <u16 as Into<T>>::into(config.width);
     |                                                                          +++++++++++++++++++++++            ~

For more information about this error, try `rustc --explain E0283`.
error: could not compile `uu_ls` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `coreutils v0.0.30`, intermediate artifacts can be found at `/var/folders/nj/85n8jzjs3z581ctc2_w21ws40000gn/T/cargo-installGzU5ks`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Command used:

cargo install coreutils --features macos

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions