Skip to content

None treated like variable name in Option match #17759

@lewoberst

Description

@lewoberst

rust-analyzer version: rust-analyzer 0.3.2053-standalone

rustc version: rustc 1.79.0

editor or extension: neovim v0.9.5 (rust-analyzer installed by mason plugin, running on a debian stable installation)

code snippet to reproduce:

fn main() -> Result<(), ()> {
    let v = Some(false);                                                                             
    let _i = match v {
        Some(true) => 1,
        Some(false) => 2,
        None => 3,
    };
    Ok(())
}

"Variable None should have snake_case name, e.g. none [non_snake_case]" in line 6.

rust-analyzer prints that as a warning message for every Option match, also if None occurs within tuples. It doesn't make any sense to me. Other than that, rust-analyzer seems to be working fine as far as I can tell.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions