summaryrefslogtreecommitdiffstats
path: root/tests/ui/lint/dead-code/in-closure.rs
blob: c55634405ed7ba5adcb5bbd63f9bf422ed9e5c7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// edition: 2021

#![deny(dead_code)]

pub fn foo() {
    let closure = || {
        fn a() {}   //~ ERROR function `a` is never used
    };
    closure()
}

pub async fn async_foo() {
    const A: usize = 1; //~ ERROR constant `A` is never used
}

fn main() {}