about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/exit1_compile_flag_test.rs
blob: 9f83ed325336911189f7e7aa99bbfa5faaff6b1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//@compile-flags: --test
#![warn(clippy::exit)]

fn not_main() {
    if true {
        std::process::exit(4);
        //~^ exit
    }
}

fn main() {
    if true {
        std::process::exit(2);
    };
    not_main();
    std::process::exit(1);
}