Skip to content

Dead code check false positive for static used in match #10865

Closed
@jfager

Description

@jfager

With #10477 landed, the following snippet complains that FOO is unused:

static FOO: u16 = 1;

fn main() {
    let i = 1;
    match i {
        FOO => println!("matched"),
        _ => println!("unmatched")
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions