diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/proc_macro_api/Cargo.toml | 1 | ||||
-rw-r--r-- | crates/proc_macro_api/src/process.rs | 11 |
2 files changed, 4 insertions, 8 deletions
diff --git a/crates/proc_macro_api/Cargo.toml b/crates/proc_macro_api/Cargo.toml index 078568cb2..f09726223 100644 --- a/crates/proc_macro_api/Cargo.toml +++ b/crates/proc_macro_api/Cargo.toml | |||
@@ -18,3 +18,4 @@ jod-thread = "0.1.1" | |||
18 | 18 | ||
19 | tt = { path = "../tt", version = "0.0.0" } | 19 | tt = { path = "../tt", version = "0.0.0" } |
20 | base_db = { path = "../base_db", version = "0.0.0" } | 20 | base_db = { path = "../base_db", version = "0.0.0" } |
21 | stdx = { path = "../stdx", version = "0.0.0" } | ||
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 | ||
12 | use crossbeam_channel::{bounded, Receiver, Sender}; | 12 | use crossbeam_channel::{bounded, Receiver, Sender}; |
13 | use stdx::JodChild; | ||
13 | 14 | ||
14 | use crate::{ | 15 | use 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 | ||
118 | struct Process { | 119 | struct Process { |
119 | child: Child, | 120 | child: JodChild, |
120 | } | ||
121 | |||
122 | impl Drop for Process { | ||
123 | fn drop(&mut self) { | ||
124 | let _ = self.child.kill(); | ||
125 | } | ||
126 | } | 121 | } |
127 | 122 | ||
128 | impl Process { | 123 | impl 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 | ||