-
Notifications
You must be signed in to change notification settings - Fork 130
Open
Labels
experience-hardThis issue is hard, and requires a lot of experienceThis issue is hard, and requires a lot of experiencehelp wantedExtra attention is neededExtra attention is needed
Description
Syntax
We should be able to add special syntax so that existing uses of transmute! are unaffected, while users are able to opt-in to prefix transmute behavior:
// Current behavior, remains the default.
transmute!(a);
// Opt-in to prefix transmutation (exact syntax to be bikeshedded)
transmute!(@prefix a);Design
Currently, we require that mem::transmute::<T, U>() compiles, which ensures that size_of::<T>() == size_of::<U>(). If we instead introduce a union MaxSizesOf<T, U> type, then we can instead require that mem::transmute::<MaxSizesOf<T, U>, T>() compiles. This ensures that size_of::<T>() >= size_of::<U>(), which ensures that it's sound to perform a prefix transmute from T to U.
kupiakos
Metadata
Metadata
Assignees
Labels
experience-hardThis issue is hard, and requires a lot of experienceThis issue is hard, and requires a lot of experiencehelp wantedExtra attention is neededExtra attention is needed