Auto merge of #2517 - saethlin:zst-field-retagging, r=RalfJung

Skip field retagging on ZSTs, it can take forever

I just tried running the `alloc`'s tests with `miri-test-libstd` with field retagging enabled. The test suite eventually hangs on a few tests which pass around ZSTs that have a lot of fields.

I don't really know how to test this effectively. The test passes, but if you remove this fast-path it effectively just hangs the interpreter. And since it hangs _inside_ a step, there's no hope for doing some kind of timeout within the test.
This commit is contained in:
bors 2022-08-29 11:46:26 +00:00
commit 284b59c4dc
2 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1,6 @@
//@compile-flags: -Zmiri-retag-fields
// Checks that the test does not run forever (which relies on a fast path).
fn main() {
let array = [(); usize::MAX];
drop(array); // Pass the array to a function, retagging its fields
}