TimelyDataflow / abomonation

A mortifying serialization library for Rust
MIT License
322 stars 30 forks source link

Use casts instead of transmute #43

Open krdln opened 2 years ago

krdln commented 2 years ago

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