Skip to content

False positive type mismatch on matching a slice #12630

Closed
@inflation

Description

@inflation

rust-analyzer version: (eg. output of "Rust Analyzer: Show RA Version" command)
rust-analyzer version: 0.0.0 (434e718 2022-06-23)
rustc version: (eg. output of rustc -V)
1.61.0
relevant settings: (eg. client settings, or environment variables like CARGO, RUSTUP_HOME or CARGO_HOME)

let buf = [0u8; 10];
match &buf[..] {
    b"yes" => println!("yes"),
    _ => println!("no"),
}

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tytype system / type inference / traits / method resolutionC-bugCategory: bugS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions