Closed
Description
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