lkml.org 
[lkml]   [2023]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 2/8] rust: add offset_of! macro
From
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

\
 
 \ /
  Last update: 2023-06-07 17:15    [W:0.128 / U:1.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site