Add an explicit scope around a lock

This commit is contained in:
Richard Feldman 2022-05-02 10:28:08 -04:00
parent 929a1e0083
commit 7e0265adc2
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798

View file

@ -293,7 +293,11 @@ fn start_phase<'a>(
}
}
let skip_constraint_gen = state.cached_subs.lock().contains_key(&module_id);
let skip_constraint_gen = {
// Give this its own scope to make sure that the Guard from the lock() is dropped
// immediately after contains_key returns
state.cached_subs.lock().contains_key(&module_id)
};
BuildTask::CanonicalizeAndConstrain {
parsed,