Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit ac54d49

Browse files
committed
Freeze Definitions earlier
1 parent 6881eed commit ac54d49

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_hir_analysis/src

1 file changed

+4
-0
lines changed

compiler/rustc_hir_analysis/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ pub fn check_crate(tcx: TyCtxt<'_>) -> Result<(), ErrorGuaranteed> {
237237
tcx.hir().for_each_module(|module| tcx.ensure().check_mod_item_types(module))
238238
});
239239

240+
// Freeze definitions as we don't add new ones at this point. This improves performance by
241+
// allowing lock-free access to them.
242+
tcx.untracked().definitions.freeze();
243+
240244
// FIXME: Remove this when we implement creating `DefId`s
241245
// for anon constants during their parents' typeck.
242246
// Typeck all body owners in parallel will produce queries

0 commit comments

Comments
 (0)