Lines Matching refs:field
43 /// Prevents complilation if the specified field name is not a part of the
61 ($type:path, $field:tt) => {
62 // Make sure the field actually exists. This line ensures that a
63 // compile-time error is generated if $field is accessed through a
66 let $type { $field: _, .. };
73 ($type:path, $field:tt) => {
74 // Make sure the field actually exists. This line ensures that a
75 // compile-time error is generated if $field is accessed through a
77 let $type { $field: _, .. };
94 ($type:ty, $field:tt) => {
104 ($type:ty, $field:tt) => {
111 /// Unfortunately accepts single-field structs as well, which is not ideal,
129 ($type:path, $field:tt) => {
130 // Make sure the field actually exists. This line ensures that a
131 // compile-time error is generated if $field is accessed through a
137 let $type { $field: _ };
145 ($type:path, $field:tt) => {
146 // Make sure the field actually exists. This line ensures that a
147 // compile-time error is generated if $field is accessed through a
152 let $type { $field: _ };
157 /// Computes a const raw pointer to the given field of the given base pointer
164 ($base:expr, $parent:path, $field:tt) => {{
165 _memoffset__field_check!($parent, $field);
168 // Get the field address.
170 // of the field check we did above.
173 _memoffset__addr_of!((*(base as *const $parent)).$field)
178 /// Computes a const raw pointer to the given field of the given base pointer
186 ($base:expr, $parent:ty, $field:tt) => {{
187 _memoffset__field_check_tuple!($parent, $field);
190 // Get the field address.
192 // of the field check we did above.
195 _memoffset__addr_of!((*(base as *const $parent)).$field)
200 /// Computes a const raw pointer to the given field of the given base pointer
209 /// Due to macro_rules limitations, this check will accept structs with a single field as well as unions.
214 ($base:expr, $parent:path, $field:tt) => {{
215 _memoffset__field_check_union!($parent, $field);
218 // Get the field address.
220 // of the field check we did above.
223 _memoffset__addr_of!((*(base as *const $parent)).$field)