jito-labs / searcher-examples

Searcher Examples
327 stars 127 forks source link

Build failaure when compiling `time` crate with Rust 1.80.0 #58

Open yfaming opened 3 months ago

yfaming commented 3 months ago

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, https://github.com/rust-lang/rust/pull/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.