about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-07-01 08:11:51 +0000
committerbors <bors@rust-lang.org>2022-07-01 08:11:51 +0000
commit7d0e5aea902b7f8d8fba6d64d9209c1f45a268b4 (patch)
treece8598c826c779514d6c7fbd29376cd83a1cc2c2
parentce36446943a33b01de50ca27d8d17e176af13cd5 (diff)
parentddddca8717c3d55b1cd019a4ae9fddb30d6d52f7 (diff)
downloadrust-7d0e5aea902b7f8d8fba6d64d9209c1f45a268b4.tar.gz
rust-7d0e5aea902b7f8d8fba6d64d9209c1f45a268b4.zip
Auto merge of #12660 - Veykril:flycheck, r=Veykril
fix: Fix flycheck sending cancel progress with no running process

Fixes #12659
-rw-r--r--crates/flycheck/src/lib.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/flycheck/src/lib.rs b/crates/flycheck/src/lib.rs
index df666ae097b..f683fe61fe3 100644
--- a/crates/flycheck/src/lib.rs
+++ b/crates/flycheck/src/lib.rs
@@ -157,12 +157,9 @@ impl FlycheckActor {
         while let Some(event) = self.next_event(&inbox) {
             match event {
                 Event::Restart(Restart) => {
-                    if let Some(cargo_handle) = self.cargo_handle.take() {
-                        // Cancel the previously spawned process
-                        cargo_handle.cancel();
-                    }
+                    // Cancel the previously spawned process
+                    self.cancel_check_process();
                     while let Ok(Restart) = inbox.recv_timeout(Duration::from_millis(50)) {}
-                    self.progress(Progress::DidCancel);
 
                     let command = self.check_command();
                     tracing::debug!(?command, "will restart flycheck");
@@ -221,6 +218,7 @@ impl FlycheckActor {
             self.progress(Progress::DidCancel);
         }
     }
+
     fn check_command(&self) -> Command {
         let mut cmd = match &self.config {
             FlycheckConfig::CargoCommand {