mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 05:03:21 +00:00
26 lines
635 B
Rust
26 lines
635 B
Rust
#![warn(clippy::zombie_processes)]
|
|
#![allow(clippy::needless_return)]
|
|
|
|
use std::process::{Child, Command};
|
|
|
|
fn main() {
|
|
let _ = Command::new("").spawn().unwrap();
|
|
//~^ ERROR: spawned process is never `wait()`ed on
|
|
Command::new("").spawn().unwrap();
|
|
//~^ ERROR: spawned process is never `wait()`ed on
|
|
spawn_proc();
|
|
//~^ ERROR: spawned process is never `wait()`ed on
|
|
spawn_proc().wait().unwrap(); // OK
|
|
}
|
|
|
|
fn not_main() {
|
|
Command::new("").spawn().unwrap();
|
|
}
|
|
|
|
fn spawn_proc() -> Child {
|
|
Command::new("").spawn().unwrap()
|
|
}
|
|
|
|
fn spawn_proc_2() -> Child {
|
|
return Command::new("").spawn().unwrap();
|
|
}
|