Skip to main content

derive_unary

Macro derive_unary 

Source
macro_rules! derive_unary {
    (@try_map_payload $f:ident) => { ... };
    (@try_map_payload $f:ident $marker:ident) => { ... };
    (@map_payload $f:ident) => { ... };
    (@map_payload $f:ident $marker:ident) => { ... };
    (@mir_ty $name:ident) => { ... };
    (@mir_ty $name:ident $marker:ident) => { ... };
    ($($name:ident $(($marker:ident))?),* $(,)?) => { ... };
}
Expand description

Temporary macro that generates the equivalent of what enum_dispatch will do in the future. We need this manual macro implementation to delegate to the previous manual implementation for variants that use the old definitions.

Once everything is handled by this macro we can remove it and replace it with enum_dispatch

Variants marked (E) have payload structs generic over the stored expression type. The marker must be the literal ident E, matching the generic parameter the macro declares.