interpret: do not call machine read hooks during validation by RalfJung · Pull Request #122249 · rust-lang/rust (original) (raw)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit torn about whether before_alloc_read
should be suppressed during validation. OTOH it is nice that we can now remove this code here. On the other hand, now if validation does do a read from this static, it will see Uninit
and show a surprising error rather than triggering a cycle error. I don't know if it is even possible to do that, it would require a copy_op_transmute
from the static to somewhere else.
If validation passes, we'll still get the cycle error from the actual read part of copy_op
.