diff --git a/src/helpers.rs b/src/helpers.rs index e5203becd5..3eafb28b89 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -232,10 +232,13 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx // we cannot determine the variant we are in. Reading from // memory would be subject to Stacked Borrows rules, leading // to all sorts of "funny" recursion. - self.visit_union(v) + // We only end up here if the type is *not* freeze, so we just call the + // `UnsafeCell` action. + (self.unsafe_cell_action)(v) } layout::Variants::Single { .. } => { - // Proceed further + // Proceed further, try to find where exactly that `UnsafeCell` + // is hiding. self.walk_value(v) } }