mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +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,
|
revision: Revision,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
debug_assert!(revision < db.salsa_runtime().current_revision());
|
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 {
|
let Some((key, slot)) = read.get_index(index as usize) else {
|
||||||
return false;
|
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 {
|
fn fetch(&self, db: &<Q as QueryDb<'_>>::DynDb, key: &Q::Key) -> Q::Value {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue