Gilnaa / memoffset

offsetof for Rust
MIT License
224 stars 29 forks source link

Support unions in offset_of(_union) #67

Closed Gilnaa closed 2 years ago

Gilnaa commented 2 years ago

Closes https://github.com/Gilnaa/memoffset/issues/66

Note that the matcher for union type is $parent:path all throughout; otherwise you get error: expected identifier, found STRUCT_NAME when attempting to expand the macro. I have to admit I'm not sure what's the significance of this. (Original offset_of uses :path, tuple uses :ty)

RalfJung commented 2 years ago

LGTM!

Gilnaa commented 2 years ago

Thank you Ralf. A pleasure, as always