small optimization
This commit is contained in:
parent
79dd70fd9b
commit
f3ff10005a
1 changed files with 5 additions and 2 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue