Skip to content

Commit 2f555de

Browse files
committed
Add a temporary hack before env fix lands in bootstrap
1 parent 6b5f63c commit 2f555de

File tree

1 file changed

+17
-4
lines changed
  • compiler/rustc_middle/src/query

1 file changed

+17
-4
lines changed

compiler/rustc_middle/src/query/mod.rs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -771,11 +771,24 @@ rustc_queries! {
771771
desc { |tcx| "type-checking `{}`", tcx.def_path_str(key.to_def_id()) }
772772
cache_on_disk_if { true }
773773
load_cached(tcx, id) {
774-
let typeck_results: Option<ty::TypeckResults<'tcx>> = tcx
775-
.on_disk_cache().as_ref()
776-
.and_then(|c| c.try_load_query_result(*tcx, id));
774+
#[cfg(bootstrap)]
775+
{
776+
match match tcx.on_disk_cache().as_ref() {
777+
Some(c) => c.try_load_query_result(*tcx, id),
778+
None => None,
779+
} {
780+
Some(x) => Some(&*tcx.arena.alloc(x)),
781+
None => None,
782+
}
783+
}
784+
#[cfg(not(bootstrap))]
785+
{
786+
let typeck_results: Option<ty::TypeckResults<'tcx>> = tcx
787+
.on_disk_cache().as_ref()
788+
.and_then(|c| c.try_load_query_result(*tcx, id));
777789

778-
typeck_results.map(|x| &*tcx.arena.alloc(x))
790+
typeck_results.map(|x| &*tcx.arena.alloc(x))
791+
}
779792
}
780793
}
781794

0 commit comments

Comments
 (0)