Skip to content

unreachable_code lint doesn't work with unboxed closures #20574

Closed
@japaric

Description

@japaric

This compiles, but it shouldn't

#![deny(unreachable_code)]

fn main() {
    let uc = |&:| panic!();
    uc();
    println!("unreachable");
}

This is correctly rejected

#![deny(unreachable_code)]

fn main() {
    let bc = || -> ! panic!();
    bc();
    println!("unreachable");
}

version: rustc 0.13.0-nightly (c6c786671 2015-01-04 00:50:59 +0000)

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