stack_dst-rs
stack_dst-rs copied to clipboard
miri is detecting undefined behavior
Latest version of miri is not happy with that line in the make_fat_ptr function.
cargo +nightly miri test
test retain ... error: Undefined Behavior: constructing invalid value: encountered 0x2598e0[noalloc], but expected a vtable pointer
--> stack_dst-rs/src/lib.rs:314:14
|
314 | let rv = rv.ptr;
| ^^^^^^ constructing invalid value: encountered 0x2598e0[noalloc], but expected a vtable pointer
|
--> stack_dst-rs/src/fifo.rs:224:23
|
224 | &mut *super::make_fat_ptr(data.as_mut_ptr() as *mut (), meta)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `retain`
--> tests/fifo.rs:71:5
|
71 | stack.retain(|v| v.as_ref().0 > 2);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside closure
--> tests/fifo.rs:47:12
This may be related to miri dropping support for simulating vtables, as explained here:
https://github.com/uazu/stakker/blob/5821c30409c19ca9167808b669c928c94bc5f177/src/queue/flat.rs#L14-L17
Well, that'd explain it