Skip to content

Commit 5de82b9

Browse files
committed
Drop the lock guard
1 parent 19c1012 commit 5de82b9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc/ty/query/plumbing.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ impl<'a, 'tcx, Q: QueryDescription<'tcx>> JobOwner<'a, 'tcx, Q> {
112112
let key_hash = state.finish();
113113

114114
let shard = cache.get_shard_index_by_hash(key_hash);
115-
let mut lock = cache.get_shard_by_index(shard).lock();
116-
let lock = &mut *lock;
115+
let mut lock_guard = cache.get_shard_by_index(shard).lock();
116+
let lock = &mut *lock_guard;
117117

118118
if let Some((_, value)) =
119119
lock.results.raw_entry().from_key_hashed_nocheck(key_hash, key)
@@ -183,7 +183,7 @@ impl<'a, 'tcx, Q: QueryDescription<'tcx>> JobOwner<'a, 'tcx, Q> {
183183
});
184184
}
185185
};
186-
mem::drop(lock);
186+
mem::drop(lock_guard);
187187

188188
// If we are single-threaded we know that we have cycle error,
189189
// so we just return the error.

0 commit comments

Comments
 (0)