The test mem::uninit_write_slice_cloned_no_drop added in #79607 leaks memory, which makes a Miri run of the test suite fail:
running 1 test
test mem::uninit_write_slice_cloned_no_drop ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1176 filtered out
The following memory was leaked: alloc1884656 (Rust heap, size: 16, align: 8) {
01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 │ ................
}
Running Miri on the test suite is helpful to find bugs, so we should avoid deliberate leaks to still be able to detect accidental ones. Can the test be changed to use some other means of ensuring that drop is not called, e.g. with a Bomb type?
struct Bomb;
impl Drop for Bomb {
fn drop(&mut self) { panic!(); }
}
Cc @drmeepster
The test
mem::uninit_write_slice_cloned_no_dropadded in #79607 leaks memory, which makes a Miri run of the test suite fail:Running Miri on the test suite is helpful to find bugs, so we should avoid deliberate leaks to still be able to detect accidental ones. Can the test be changed to use some other means of ensuring that
dropis not called, e.g. with aBombtype?Cc @drmeepster