Cache eval_to_allocation_raw
on disk
This commit is contained in:
parent
70148d7b31
commit
c160bf3c3e
@ -13,7 +13,7 @@
|
||||
use super::{sign_extend, truncate, AllocId, Allocation, InterpResult, Pointer, PointerArithmetic};
|
||||
|
||||
/// Represents the result of const evaluation via the `eval_to_allocation` query.
|
||||
#[derive(Clone, HashStable)]
|
||||
#[derive(Clone, HashStable, TyEncodable, TyDecodable)]
|
||||
pub struct ConstAlloc<'tcx> {
|
||||
// the value lives here, at offset 0, and that allocation definitely is a `AllocKind::Memory`
|
||||
// (so you can use `AllocMap::unwrap_memory`).
|
||||
|
@ -716,6 +716,10 @@ fn describe_as_module(def_id: LocalDefId, tcx: TyCtxt<'_>) -> String {
|
||||
"const-evaluating + checking `{}`",
|
||||
key.value.display(tcx)
|
||||
}
|
||||
cache_on_disk_if(_, opt_result) {
|
||||
// Only store results without errors
|
||||
opt_result.map_or(true, |r| r.is_ok())
|
||||
}
|
||||
}
|
||||
|
||||
/// Evaluates const items or anonymous constants
|
||||
|
Loading…
Reference in New Issue
Block a user