about summary refs log tree commit diff
path: root/compiler/rustc_query_system
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2023-05-23 14:53:36 +0000
committerMaybe Waffle <waffle.lapkin@gmail.com>2023-05-23 14:53:36 +0000
commite2b953063d1c6302dd61a2284f8da8b770ddc11d (patch)
tree4173a9803823711b86aebeb501064cab8a429977 /compiler/rustc_query_system
parentf3d597b31c0f101a02c230798afa31a36bdacbc6 (diff)
downloadrust-e2b953063d1c6302dd61a2284f8da8b770ddc11d.tar.gz
rust-e2b953063d1c6302dd61a2284f8da8b770ddc11d.zip
Don't leak the function that is called on drop
Diffstat (limited to 'compiler/rustc_query_system')
-rw-r--r--compiler/rustc_query_system/src/query/job.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_query_system/src/query/job.rs b/compiler/rustc_query_system/src/query/job.rs
index 5f2ec656d1d..f45f7ca5da6 100644
--- a/compiler/rustc_query_system/src/query/job.rs
+++ b/compiler/rustc_query_system/src/query/job.rs
@@ -22,7 +22,7 @@ use {
     rustc_data_structures::fx::FxHashSet,
     rustc_data_structures::sync::Lock,
     rustc_data_structures::sync::Lrc,
-    rustc_data_structures::{jobserver, OnDrop},
+    rustc_data_structures::{defer, jobserver},
     rustc_span::DUMMY_SP,
     std::iter,
     std::process,
@@ -530,7 +530,7 @@ fn remove_cycle<D: DepKind>(
 /// all active queries for cycles before finally resuming all the waiters at once.
 #[cfg(parallel_compiler)]
 pub fn deadlock<D: DepKind>(query_map: QueryMap<D>, registry: &rayon_core::Registry) {
-    let on_panic = OnDrop(|| {
+    let on_panic = defer(|| {
         eprintln!("deadlock handler panicked, aborting process");
         process::abort();
     });