Skip to content

Wrong variable type was hinted #11478

@NichtsHsu

Description

@NichtsHsu

rust-analyzer version: 9bc2ee3 2022-02-15 dev

rustc version: rustc 1.60.0-nightly (1e12aef 2022-02-13)

Code:

let [head, tail @ ..] =  [1, 2, 3, 4];

RA hints:

let [head: i32, tail: [i23; 4] @ ..] =  [1, 2, 3, 4];

Expected:

let [head: i32, tail: [i23; 3] @ ..] =  [1, 2, 3, 4];

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-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