@@ -10,11 +10,12 @@ use std::{
1010    time:: Duration , 
1111} ; 
1212
13+ use  command_group:: { CommandGroup ,  GroupChild } ; 
1314use  crossbeam_channel:: { never,  select,  unbounded,  Receiver ,  Sender } ; 
1415use  paths:: AbsPathBuf ; 
1516use  rustc_hash:: FxHashMap ; 
1617use  serde:: Deserialize ; 
17- use  stdx:: { process:: streaming_output,   JodChild } ; 
18+ use  stdx:: process:: streaming_output; 
1819
1920pub  use  cargo_metadata:: diagnostic:: { 
2021    Applicability ,  Diagnostic ,  DiagnosticCode ,  DiagnosticLevel ,  DiagnosticSpan , 
@@ -359,10 +360,12 @@ impl FlycheckActor {
359360    } 
360361} 
361362
363+ struct  JodChild ( GroupChild ) ; 
364+ 
362365/// A handle to a cargo process used for fly-checking. 
363366struct  CargoHandle  { 
364367    /// The handle to the actual cargo process. As we cannot cancel directly from with 
365-      /// a read syscall dropping and therefor  terminating the process is our best option. 
368+      /// a read syscall dropping and therefore  terminating the process is our best option. 
366369     child :  JodChild , 
367370    thread :  jod_thread:: JoinHandle < io:: Result < ( bool ,  String ) > > , 
368371    receiver :  Receiver < CargoMessage > , 
@@ -371,10 +374,10 @@ struct CargoHandle {
371374impl  CargoHandle  { 
372375    fn  spawn ( mut  command :  Command )  -> std:: io:: Result < CargoHandle >  { 
373376        command. stdout ( Stdio :: piped ( ) ) . stderr ( Stdio :: piped ( ) ) . stdin ( Stdio :: null ( ) ) ; 
374-         let  mut  child = JodChild :: spawn ( command) ?; 
377+         let  mut  child = command. group_spawn ( ) . map ( JodChild ) ?; 
375378
376-         let  stdout = child. stdout . take ( ) . unwrap ( ) ; 
377-         let  stderr = child. stderr . take ( ) . unwrap ( ) ; 
379+         let  stdout = child. 0 . inner ( ) . stdout . take ( ) . unwrap ( ) ; 
380+         let  stderr = child. 0 . inner ( ) . stderr . take ( ) . unwrap ( ) ; 
378381
379382        let  ( sender,  receiver)  = unbounded ( ) ; 
380383        let  actor = CargoActor :: new ( sender,  stdout,  stderr) ; 
@@ -386,13 +389,13 @@ impl CargoHandle {
386389    } 
387390
388391    fn  cancel ( mut  self )  { 
389-         let  _ = self . child . kill ( ) ; 
390-         let  _ = self . child . wait ( ) ; 
392+         let  _ = self . child . 0 . kill ( ) ; 
393+         let  _ = self . child . 0 . wait ( ) ; 
391394    } 
392395
393396    fn  join ( mut  self )  -> io:: Result < ( ) >  { 
394-         let  _ = self . child . kill ( ) ; 
395-         let  exit_status = self . child . wait ( ) ?; 
397+         let  _ = self . child . 0 . kill ( ) ; 
398+         let  exit_status = self . child . 0 . wait ( ) ?; 
396399        let  ( read_at_least_one_message,  error)  = self . thread . join ( ) ?; 
397400        if  read_at_least_one_message || exit_status. success ( )  { 
398401            Ok ( ( ) ) 
0 commit comments