Skip to content

Tuple parameters are {unknown} #12331

Closed
Closed
@Barugon

Description

@Barugon

rust-analyzer version: rust-analyzer version: 7e95c14 2022-05-17 stable

rustc version: rustc 1.61.0 (fe5b13d68 2022-05-18)

relevant settings: none

Rust Analyzer gets confused about the tuple parameters in the following code (the logic here is dumb but it's simply to illustrate):

fn main() {
    let mut item = None;
    loop {
        if let Some((id, _, _)) = item {
            if id == 1 {
                break;
            }
        }

        item = Some((1, 2.5, String::new()));
    }
}

The result is this:

Screenshot from 2022-05-20 09-19-29

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