Skip to content

Commit 4a6cfc6

Browse files
committed
Don't arena allocate Definitions
1 parent 0447f91 commit 4a6cfc6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/rustc_middle/src/ty/context.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ pub struct GlobalCtxt<'tcx> {
967967
export_map: ExportMap<LocalDefId>,
968968

969969
pub(crate) untracked_crate: &'tcx hir::Crate<'tcx>,
970-
pub(crate) definitions: &'tcx Definitions,
970+
pub(crate) definitions: Definitions,
971971

972972
/// This provides access to the incremental compilation on-disk cache for query results.
973973
/// Do not access this directly. It is only meant to be used by
@@ -1163,7 +1163,7 @@ impl<'tcx> TyCtxt<'tcx> {
11631163
glob_map: resolutions.glob_map,
11641164
extern_prelude: resolutions.extern_prelude,
11651165
untracked_crate: krate,
1166-
definitions: arena.alloc(resolutions.definitions),
1166+
definitions: resolutions.definitions,
11671167
on_disk_cache,
11681168
queries,
11691169
query_caches: query::QueryCaches::default(),
@@ -1319,14 +1319,14 @@ impl<'tcx> TyCtxt<'tcx> {
13191319
pub fn create_stable_hashing_context(self) -> StableHashingContext<'tcx> {
13201320
let krate = self.gcx.untracked_crate;
13211321

1322-
StableHashingContext::new(self.sess, krate, self.definitions, &*self.cstore)
1322+
StableHashingContext::new(self.sess, krate, &self.definitions, &*self.cstore)
13231323
}
13241324

13251325
#[inline(always)]
13261326
pub fn create_no_span_stable_hashing_context(self) -> StableHashingContext<'tcx> {
13271327
let krate = self.gcx.untracked_crate;
13281328

1329-
StableHashingContext::ignore_spans(self.sess, krate, self.definitions, &*self.cstore)
1329+
StableHashingContext::ignore_spans(self.sess, krate, &self.definitions, &*self.cstore)
13301330
}
13311331

13321332
pub fn serialize_query_result_cache(self, encoder: &mut FileEncoder) -> FileEncodeResult {

0 commit comments

Comments
 (0)