Skip to content

Build failaure when compiling time crate with Rust 1.80.0 #58

@yfaming

Description

@yfaming

Here is my Rust version info.

# cargo --version
cargo 1.80.0 (376290515 2024-07-16)

# rustc --version
rustc 1.80.0 (051478957 2024-07-21)

And the compilation error is below:

error[E0282]: type annotations needed for `Box<_>`
  --> /Users/yfaming/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.34/src/format_description/parse/mod.rs:83:9
   |
83 |     let items = format_items
   |         ^^^^^
...
86 |     Ok(items.into())
   |              ---- type must be known at this point
   |
help: consider giving `items` an explicit type, where the placeholders `_` are specified
   |
83 |     let items: Box<_> = format_items
   |              ++++++++

After some googling, I think the solution is upgrading time to 0.3.36. Here is an PR in rustlang/rust doing the same upgrade, rust-lang/rust#124736 . And it described the root cause.

But since time crate is just one of the indirect dependencies of this repo, I'd suggest add time = 0.3.36 to searcher_client/Cargo.toml to pin the version.

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