aboutsummaryrefslogtreecommitdiff
path: root/crates/flycheck
diff options
context:
space:
mode:
Diffstat (limited to 'crates/flycheck')
-rw-r--r--crates/flycheck/Cargo.toml3
-rw-r--r--crates/flycheck/src/lib.rs23
2 files changed, 3 insertions, 23 deletions
diff --git a/crates/flycheck/Cargo.toml b/crates/flycheck/Cargo.toml
index 3d9436d69..1d19c7886 100644
--- a/crates/flycheck/Cargo.toml
+++ b/crates/flycheck/Cargo.toml
@@ -12,8 +12,9 @@ doctest = false
12[dependencies] 12[dependencies]
13crossbeam-channel = "0.5.0" 13crossbeam-channel = "0.5.0"
14log = "0.4.8" 14log = "0.4.8"
15cargo_metadata = "=0.12.0" 15cargo_metadata = "0.12.2"
16serde_json = "1.0.48" 16serde_json = "1.0.48"
17jod-thread = "0.1.1" 17jod-thread = "0.1.1"
18 18
19toolchain = { path = "../toolchain", version = "0.0.0" } 19toolchain = { path = "../toolchain", version = "0.0.0" }
20stdx = { path = "../stdx", version = "0.0.0" }
diff --git a/crates/flycheck/src/lib.rs b/crates/flycheck/src/lib.rs
index d982c5f29..4388e8c67 100644
--- a/crates/flycheck/src/lib.rs
+++ b/crates/flycheck/src/lib.rs
@@ -5,13 +5,13 @@
5use std::{ 5use std::{
6 fmt, 6 fmt,
7 io::{self, BufReader}, 7 io::{self, BufReader},
8 ops,
9 path::PathBuf, 8 path::PathBuf,
10 process::{self, Command, Stdio}, 9 process::{self, Command, Stdio},
11 time::Duration, 10 time::Duration,
12}; 11};
13 12
14use crossbeam_channel::{never, select, unbounded, Receiver, Sender}; 13use crossbeam_channel::{never, select, unbounded, Receiver, Sender};
14use stdx::JodChild;
15 15
16pub use cargo_metadata::diagnostic::{ 16pub use cargo_metadata::diagnostic::{
17 Applicability, Diagnostic, DiagnosticCode, DiagnosticLevel, DiagnosticSpan, 17 Applicability, Diagnostic, DiagnosticCode, DiagnosticLevel, DiagnosticSpan,
@@ -323,24 +323,3 @@ impl CargoActor {
323 Ok(read_at_least_one_message) 323 Ok(read_at_least_one_message)
324 } 324 }
325} 325}
326
327struct JodChild(process::Child);
328
329impl ops::Deref for JodChild {
330 type Target = process::Child;
331 fn deref(&self) -> &process::Child {
332 &self.0
333 }
334}
335
336impl ops::DerefMut for JodChild {
337 fn deref_mut(&mut self) -> &mut process::Child {
338 &mut self.0
339 }
340}
341
342impl Drop for JodChild {
343 fn drop(&mut self) {
344 let _ = self.0.kill();
345 }
346}