Skip to content

Type annotations needed in assertion  #113283

Closed
@laurmaedje

Description

@laurmaedje

Code

I tried this code:

fn main() {
    let array: [Box<i32>; 0] = [];
    assert_eq!(array.into_iter().collect::<Vec<_>>(), []);
}

I expected to see this happen: Compiles and assertion passes.

Instead, this happened: Compiler wants type annotation somewhere in assertion. Span is on whole assertion.

Version it worked on

It most recently worked on: 1.70 stable

Version with regression

Recent nightlies (also occurs on Rust playground)

rustc --version --verbose:

rustc 1.72.0-nightly (839e9a6e1 2023-07-02)
binary: rustc
commit-hash: 839e9a6e1210934fd24b15548b811a97c77138fc
commit-date: 2023-07-02
host: aarch64-apple-darwin
release: 1.72.0-nightly
LLVM version: 16.0.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions