Skip to content

Panic in cyclomatic complexity lint #478

@shahn

Description

@shahn

The following reduced code produces a panic:

#![feature(plugin)]
#![plugin(clippy)]

#[allow(dead_code)]
enum Baz {
    Baz1,
    Baz2,
}

struct Test {
    t: Option<usize>,
    b: Baz,
}

fn main() {
    use Baz::*;
    let x = Test { t: Some(0), b: Baz1 };

    match x {
        Test { t: Some(a), b: Baz1 } => unreachable!(),
        Test { t: None, .. } => unreachable!(),
        Test { .. } => unreachable!(),

    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions