mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-14 14:13:58 +00:00
internal: fix deadlock introduced by #16643
This commit is contained in:
parent
12144045fe
commit
64779737db
1 changed files with 5 additions and 2 deletions
|
@ -146,11 +146,14 @@ where
|
|||
revision: Revision,
|
||||
) -> bool {
|
||||
debug_assert!(revision < db.salsa_runtime().current_revision());
|
||||
let read = &self.slot_map.read();
|
||||
let read = self.slot_map.read();
|
||||
let Some((key, slot)) = read.get_index(index as usize) else {
|
||||
return false;
|
||||
};
|
||||
slot.maybe_changed_after(db, revision, key)
|
||||
let (key, slot) = (key.clone(), slot.clone());
|
||||
// note: this drop is load-bearing. removing it would causes deadlocks.
|
||||
drop(read);
|
||||
slot.maybe_changed_after(db, revision, &key)
|
||||
}
|
||||
|
||||
fn fetch(&self, db: &<Q as QueryDb<'_>>::DynDb, key: &Q::Key) -> Q::Value {
|
||||
|
|
Loading…
Reference in a new issue