Skip to content

Commit 7d0e5ae

Browse files
committed
Auto merge of rust-lang#12660 - Veykril:flycheck, r=Veykril
fix: Fix flycheck sending cancel progress with no running process Fixes rust-lang#12659
2 parents ce36446 + ddddca8 commit 7d0e5ae

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

crates/flycheck/src/lib.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,9 @@ impl FlycheckActor {
157157
while let Some(event) = self.next_event(&inbox) {
158158
match event {
159159
Event::Restart(Restart) => {
160-
if let Some(cargo_handle) = self.cargo_handle.take() {
161-
// Cancel the previously spawned process
162-
cargo_handle.cancel();
163-
}
160+
// Cancel the previously spawned process
161+
self.cancel_check_process();
164162
while let Ok(Restart) = inbox.recv_timeout(Duration::from_millis(50)) {}
165-
self.progress(Progress::DidCancel);
166163

167164
let command = self.check_command();
168165
tracing::debug!(?command, "will restart flycheck");
@@ -221,6 +218,7 @@ impl FlycheckActor {
221218
self.progress(Progress::DidCancel);
222219
}
223220
}
221+
224222
fn check_command(&self) -> Command {
225223
let mut cmd = match &self.config {
226224
FlycheckConfig::CargoCommand {

0 commit comments

Comments
 (0)