enable `-Zrandomize-layout` for miri tests
hawkw opened this issue · 0 comments
hawkw commented
we should be running Miri tests with RUSTFLAGS="-Zrandomize-layout"
. cordyceps
and maitake
currently contain code that perform layout-dependent casts (in this case, casting a ptr to struct to a ptr to the struct's first subfield), which would be UB if those structs were not #[repr(C)]
. i believe that running the Miri tests with this flag would help catch any cases where a layout-dependent cast is inadvertently performed with a type that is not #[repr(C)]
(or #[repr(transparent)]
?), so we should be enabling it in our Miri CI jobs to catch any potential bugs involving this...