-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
Without one of those attributes, my understanding is the transmute from &[T] to &RevSlice<T> is undefined behavior. The compiler is free to stick some additional data at the start of RevSlice<T> or give it a stricter alignment than [T]. For example some targets may require all struct types to have some minimum alignment that is not required for slices.
From nomicon's Alternative representations:
#[repr(C)]
is also necessary to soundly do more elaborate tricks with data layout such as reinterpreting values as a different type.
Metadata
Metadata
Assignees
Labels
No labels