about summary refs log tree commit diff
path: root/tests/ui/lint/dead-code/const-underscore-issue-142104.rs
blob: b255027e0f1ce6603426d5ea9199eeffedcb4da5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ check-pass

// This test makes sure we always considers `const _` items as live for dead code analysis.

#![deny(dead_code)]

const fn is_nonzero(x: u8) -> bool {
    x != 0
}

const _: () = {
    assert!(is_nonzero(2));
};

fn main() {}