Macro to generate self-borrowing structs