diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2020-02-12 12:26:27 +0100 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2020-02-12 12:33:31 +0100 |
| commit | 5de82b926486edc54d7183971fde901be9445c6b (patch) | |
| tree | 39c42575f6f00ce9fcc351534cc0d7e044bf4195 | |
| parent | 19c1012483fe8fb3c793a6ba83f97d896c6a6c98 (diff) | |
| download | rust-5de82b926486edc54d7183971fde901be9445c6b.tar.gz rust-5de82b926486edc54d7183971fde901be9445c6b.zip | |
Drop the lock guard
| -rw-r--r-- | src/librustc/ty/query/plumbing.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc/ty/query/plumbing.rs b/src/librustc/ty/query/plumbing.rs index 4fa82156c40..4e7a23be383 100644 --- a/src/librustc/ty/query/plumbing.rs +++ b/src/librustc/ty/query/plumbing.rs @@ -112,8 +112,8 @@ impl<'a, 'tcx, Q: QueryDescription<'tcx>> JobOwner<'a, 'tcx, Q> { let key_hash = state.finish(); let shard = cache.get_shard_index_by_hash(key_hash); - let mut lock = cache.get_shard_by_index(shard).lock(); - let lock = &mut *lock; + let mut lock_guard = cache.get_shard_by_index(shard).lock(); + let lock = &mut *lock_guard; if let Some((_, value)) = 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> { }); } }; - mem::drop(lock); + mem::drop(lock_guard); // If we are single-threaded we know that we have cycle error, // so we just return the error. |
