rust/tests/ui/lint/dead-code/in-closure.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
263 B
Rust
Raw Normal View History

2023-02-21 10:11:48 -06:00
//@ 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() {}