Skip to content

Type inference failure on let foo: [_; _] = [false] as _; #20644

@nicolas-guichard

Description

@nicolas-guichard

Rust-analyzer fails to infer the type of foo in the statement let foo: [_; _] = [false] as _;.
This was introduced by #20578 (this fails on 412932e but not on 6da1ce7).

rust-analyzer version: master (07b68bd)

rustc version: rustc 1.91.0-nightly (3672a55 2025-08-13)

editor or extension: N/A

relevant settings: N/A

repository link (if public, optional): nicolas-guichard@4b57659

code snippet to reproduce:

fn main() {
  let foo: [_; _] = [false] as _; // fails to infer the type of foo
}

Metadata

Metadata

Labels

A-new-solverBugs from the new solver migration - should be fixed before stable releaseA-tytype system / type inference / traits / method resolutionC-bugCategory: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions