mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 10:05:06 +03:00
fix Stacked Borrows interaction with dyn*
This commit is contained in:
@@ -478,6 +478,10 @@ fn visit_value(&mut self, v: &MPlaceTy<'tcx, Provenance>) -> InterpResult<'tcx>
|
||||
} else if matches!(v.layout.fields, FieldsShape::Union(..)) {
|
||||
// A (non-frozen) union. We fall back to whatever the type says.
|
||||
(self.unsafe_cell_action)(v)
|
||||
} else if matches!(v.layout.ty.kind(), ty::Dynamic(_, _, ty::DynStar)) {
|
||||
// This needs to read the vtable pointer to proceed type-driven, but we don't
|
||||
// want to reentrantly read from memory here.
|
||||
(self.unsafe_cell_action)(v)
|
||||
} else {
|
||||
// We want to not actually read from memory for this visit. So, before
|
||||
// walking this value, we have to make sure it is not a
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// Dyn* handling leads to some funky reentrancy in Stacked Borrows, for some reason
|
||||
//@compile-flags: -Zmiri-disable-stacked-borrows
|
||||
#![feature(dyn_star)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user