Skip to content

Cannot compile bat: error[E0282]: type annotations needed for Box<_> #3043

Closed
@brenton-at-pieces

Description

I am trying to build bat, but running into an error.

% rustup -V
rustup 1.27.1 (54dd3d00f 2024-04-24)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.80.0 (051478957 2024-07-21)`

% cargo build
   Compiling libc v0.2.149
   Compiling proc-macro2 v1.0.79
   Compiling unicode-ident v1.0.4
   Compiling serde v1.0.199
   Compiling memchr v2.6.4
   Compiling pkg-config v0.3.25
   Compiling regex-syntax v0.8.2
   Compiling hashbrown v0.14.1
   Compiling equivalent v1.0.1
   Compiling strsim v0.10.0
   Compiling fnv v1.0.7
   Compiling rustix v0.38.21
   Compiling ident_case v1.0.1
   Compiling bitflags v2.4.0
   Compiling cfg-if v1.0.0
   Compiling utf8parse v0.2.1
   Compiling colorchoice v1.0.0
   Compiling anstyle-parse v0.2.0
   Compiling anstyle v1.0.0
   Compiling tinyvec_macros v0.1.0
   Compiling itoa v1.0.3
   Compiling anstyle-query v1.0.0
   Compiling crc32fast v1.3.2
   Compiling tinyvec v1.6.0
   Compiling same-file v1.0.6
   Compiling anstream v0.6.4
   Compiling powerfmt v0.2.0
   Compiling once_cell v1.19.0
   Compiling anyhow v1.0.86
   Compiling aho-corasick v1.1.2
   Compiling clap_lex v0.6.0
   Compiling winnow v0.5.18
   Compiling deranged v0.3.11
   Compiling indexmap v2.2.6
   Compiling walkdir v2.5.0
   Compiling ryu v1.0.11
   Compiling serde_json v1.0.85
   Compiling adler v1.0.2
   Compiling either v1.8.0
   Compiling log v0.4.20
   Compiling num-conv v0.1.0
   Compiling thiserror v1.0.61
   Compiling percent-encoding v2.2.0
   Compiling safemem v0.3.3
   Compiling time-core v0.1.2
   Compiling unicode-bidi v0.3.8
   Compiling line-wrap v0.1.1
   Compiling itertools v0.13.0
   Compiling form_urlencoded v1.1.0
   Compiling miniz_oxide v0.7.1
   Compiling unicode-normalization v0.1.22
   Compiling time v0.3.34
   Compiling quick-xml v0.31.0
   Compiling quote v1.0.35
error[E0282]: type annotations needed for `Box<_>`
  --> /Users/brenton/.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
   |              ++++++++

   Compiling regex-automata v0.4.3
   Compiling syn v2.0.57
   Compiling idna v0.3.0
   Compiling semver v1.0.23
   Compiling bugreport v0.5.0
   Compiling base64 v0.21.0
   Compiling bytemuck v1.12.1
For more information about this error, try `rustc --explain E0282`.
error: could not compile `time` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

If I run cargo update, I can then build.

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingupstream-errorA bug in an upstream component

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions