Skip to content

enable -Zrandomize-layout for miri tests #229

Closed
@hawkw

Description

@hawkw

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...

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions