Add lint for exit

This commit is contained in:
Heinz N. Gies 2019-10-18 21:09:42 +02:00
parent 7531a08eed
commit 695aa59c6d
5 changed files with 58 additions and 0 deletions

4
tests/ui/exit.rs Normal file
View file

@ -0,0 +1,4 @@
#[warn(clippy::exit)]
fn main() {
std::process::exit(1);
}

10
tests/ui/exit.stderr Normal file
View file

@ -0,0 +1,10 @@
error: usage of `process::exit`
--> $DIR/exit.rs:3:5
|
LL | std::process::exit(1);
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::exit` implied by `-D warnings`
error: aborting due to previous error