Skip to content

Conversation

krdln
Copy link

@krdln krdln commented Mar 23, 2022

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:

    env MIRIFLAGS='-Zmiri-disable-alignment-check -Zmiri-disable-validation -Zmiri-tag-raw-pointers' \
        cargo miri test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant