Skip to content

Regression in type annotations needed for check between 1.79 and 1.80 #128242

Closed as not planned
@Fishrock123

Description

@Fishrock123

Code

I tried this code:

[package]
name = "example"
version = "0.1.0"
edition = "2021"

[dependencies]
time = { version = "=0.3.34", features = ["formatting"] }
cargo check

Code in question for this version: https://github.com/time-rs/time/blob/f11f9b2a0c8d17badd96a8a9167d81466a3fa39b/time/src/format_description/parse/mod.rs#L66-L87

This existing source code should continue to work fine between Rust 1.79 and 1.80.

Instead, this happened:

error[E0282]: type annotations needed for `Box<_>`
  --> /Users/jsenkpiel/.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
   |              ++++++++

Version it worked on

It most recently worked on: 1.79

Version with regression

rustc --version --verbose:

rustc 1.80.0 (051478957 2024-07-21)
binary: rustc
commit-hash: 051478957371ee0084a7c0913941d2a8c4757bb9
commit-date: 2024-07-21
host: aarch64-apple-darwin
release: 1.80.0
LLVM version: 18.1.7

I think the issue was fixed by this change in time for 0.3.35. However, it should still not fail between regular Rustc version upgrades.

Apparent fix in time @ 0.3.35: time-rs/time@5b0c627 - time-rs/time#671

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-discussionCategory: Discussion or questions that doesn't represent real issues.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions