Skip to content

Commit f3ff100

Browse files
committed
small optimization
1 parent 79dd70f commit f3ff100

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/helpers.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,13 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
232232
// we cannot determine the variant we are in. Reading from
233233
// memory would be subject to Stacked Borrows rules, leading
234234
// to all sorts of "funny" recursion.
235-
self.visit_union(v)
235+
// We only end up here if the type is *not* freeze, so we just call the
236+
// `UnsafeCell` action.
237+
(self.unsafe_cell_action)(v)
236238
}
237239
layout::Variants::Single { .. } => {
238-
// Proceed further
240+
// Proceed further, try to find where exactly that `UnsafeCell`
241+
// is hiding.
239242
self.walk_value(v)
240243
}
241244
}

0 commit comments

Comments
 (0)