rust-clippy/tests/ui/exit2.rs

16 lines
288 B
Rust
Raw Normal View History

#![warn(clippy::exit)]
2019-10-21 20:55:01 +00:00
fn also_not_main() {
2019-10-19 12:31:02 +00:00
std::process::exit(3);
//~^ ERROR: usage of `process::exit`
//~| NOTE: `-D clippy::exit` implied by `-D warnings`
2019-10-19 12:31:02 +00:00
}
2019-10-18 19:09:42 +00:00
fn main() {
2019-10-19 12:31:02 +00:00
if true {
std::process::exit(2);
};
2019-10-21 20:55:01 +00:00
also_not_main();
2019-10-18 19:09:42 +00:00
std::process::exit(1);
}