Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions compiler/rustc_query_impl/src/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ where
let mut this = ManuallyDrop::new(self);

// Drop everything without poisoning the query.
this.drop_and_maybe_poison(/* poison */ false);
this.drop_and_maybe_poison::<false>();
}

fn drop_and_maybe_poison(&mut self, poison: bool) {
fn drop_and_maybe_poison<const POISON: bool>(&mut self) {
let status = {
let mut shard = self.state.active.lock_shard_by_hash(self.key_hash);
match shard.find_entry(self.key_hash, equivalent_key(self.key)) {
Expand All @@ -179,7 +179,7 @@ where
}
Ok(occupied) => {
let ((key, status), vacant) = occupied.remove();
if poison {
if POISON {
vacant.insert((key, ActiveKeyStatus::Poisoned));
}
status
Expand All @@ -203,7 +203,7 @@ where
#[cold]
fn drop(&mut self) {
// Poison the query so jobs waiting on it panic.
self.drop_and_maybe_poison(/* poison */ true);
self.drop_and_maybe_poison::<true>();
}
}

Expand Down
Loading