aboutsummaryrefslogtreecommitdiff
path: root/crates/proc_macro_api/src/process.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/proc_macro_api/src/process.rs')
-rw-r--r--crates/proc_macro_api/src/process.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/crates/proc_macro_api/src/process.rs b/crates/proc_macro_api/src/process.rs
index 6d6ab8888..3ce851fe8 100644
--- a/crates/proc_macro_api/src/process.rs
+++ b/crates/proc_macro_api/src/process.rs
@@ -10,6 +10,7 @@ use std::{
10}; 10};
11 11
12use crossbeam_channel::{bounded, Receiver, Sender}; 12use crossbeam_channel::{bounded, Receiver, Sender};
13use stdx::JodChild;
13 14
14use crate::{ 15use crate::{
15 msg::{ErrorCode, Message, Request, Response, ResponseError}, 16 msg::{ErrorCode, Message, Request, Response, ResponseError},
@@ -116,13 +117,7 @@ struct Task {
116} 117}
117 118
118struct Process { 119struct Process {
119 child: Child, 120 child: JodChild,
120}
121
122impl Drop for Process {
123 fn drop(&mut self) {
124 let _ = self.child.kill();
125 }
126} 121}
127 122
128impl Process { 123impl Process {
@@ -131,7 +126,7 @@ impl Process {
131 args: impl IntoIterator<Item = impl AsRef<OsStr>>, 126 args: impl IntoIterator<Item = impl AsRef<OsStr>>,
132 ) -> io::Result<Process> { 127 ) -> io::Result<Process> {
133 let args: Vec<OsString> = args.into_iter().map(|s| s.as_ref().into()).collect(); 128 let args: Vec<OsString> = args.into_iter().map(|s| s.as_ref().into()).collect();
134 let child = mk_child(&path, &args)?; 129 let child = JodChild(mk_child(&path, &args)?);
135 Ok(Process { child }) 130 Ok(Process { child })
136 } 131 }
137 132