Re: [PATCH v2 2/8] rust: add offset_of! macro

Alice Ryhl
2023-06-07T15:15:27Z

Andreas Hindborg (Samsung) <nmi@metaspace.dk> writes:
> Alice Ryhl <aliceryhl@google.com> writes:
>> +#[macro_export]
>> +macro_rules! offset_of {
>> + ($type:path, $field:ident) => {{
>
> Could we add a descriptive comment?
>
> // Prevent deref coersion to `$field` by requiring `$type`
> // has a field named `$field`
>
> BR Andreas

Sure. It will be in the next version of the patchset.

Alice