Use FreezeLock for CStore

This commit is contained in:
John Kåre Alsaker 2023-09-09 16:02:11 +02:00
parent 6cc1898f5f
commit 1d8fdc0332
8 changed files with 63 additions and 38 deletions

View file

@ -34,7 +34,7 @@ use rustc_ast::{AngleBracketedArg, Crate, Expr, ExprKind, GenericArg, GenericArg
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet};
use rustc_data_structures::intern::Interned;
use rustc_data_structures::steal::Steal;
use rustc_data_structures::sync::{Lrc, MappedReadGuard};
use rustc_data_structures::sync::{FreezeReadGuard, Lrc};
use rustc_errors::{
Applicability, DiagnosticBuilder, DiagnosticMessage, ErrorGuaranteed, SubdiagnosticMessage,
};
@ -1544,7 +1544,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
))
}
fn cstore(&self) -> MappedReadGuard<'_, CStore> {
fn cstore(&self) -> FreezeReadGuard<'_, CStore> {
CStore::from_tcx(self.tcx)
}
@ -1599,7 +1599,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
});
// Make sure we don't mutate the cstore from here on.
self.tcx.untracked().cstore.leak();
self.tcx.untracked().cstore.freeze();
}
fn traits_in_scope(