This commit also replaces .get_unchecked(0) with .as_ptr() (when casting slice to typed object), which makes MIRI slightly happier (in previous approach, the pointer was valid only for the first byte) – in fact, it now passes tests with following flags:
env MIRIFLAGS='-Zmiri-disable-alignment-check -Zmiri-disable-validation -Zmiri-tag-raw-pointers' \
cargo miri test
This commit also replaces
.get_unchecked(0)
with.as_ptr()
(when casting slice to typed object), which makes MIRI slightly happier (in previous approach, the pointer was valid only for the first byte) – in fact, it now passes tests with following flags: