gen_slot_packing_logic

Function gen_slot_packing_logic 

Source
pub(crate) fn gen_slot_packing_logic(
    prev_ty: &Type,
    curr_ty: &Type,
    prev_slot_expr: TokenStream,
    prev_offset_expr: TokenStream,
) -> (TokenStream, TokenStream)
Expand description

Generate slot packing decision logic.

This function generates const expressions that determine whether two consecutive fields can be packed into the same storage slot, and if so, calculates the appropriate slot index and offset. Slot expressions use U256 arithmetic, while offset expressions use usize.