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`).
"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