1
Fork 0

Auto merge of #77006 - oli-obk:🐌_const_queries, r=Mark-Simulacrum

Cache `eval_to_allocation_raw` on disk

https://github.com/rust-lang/rust/pull/74949#issuecomment-695833161 regressed the performance on these queries, this PR gets the perf back.
This commit is contained in:
bors 2020-09-24 15:12:17 +00:00
commit 87d262acb5
2 changed files with 3 additions and 5 deletions

View file

@ -716,6 +716,7 @@ rustc_queries! {
"const-evaluating + checking `{}`",
key.value.display(tcx)
}
cache_on_disk_if { true }
}
/// Evaluates const items or anonymous constants
@ -730,10 +731,7 @@ rustc_queries! {
"simplifying constant for the type system `{}`",
key.value.display(tcx)
}
cache_on_disk_if(_, opt_result) {
// Only store results without errors
opt_result.map_or(true, |r| r.is_ok())
}
cache_on_disk_if { true }
}
/// Destructure a constant ADT or array into its variant index and its