Lines Matching refs:field
43 // offset into a field, and that is UB because the pointer is dangling.
53 ($field:expr, $base:expr) => {{
54 let field = $field; // evaluate $field outside the `unsafe` block
58 unsafe { (field as *const u8).offset_from(base as *const u8) as usize }
65 ($field:expr, $base:expr) => {
67 ($field as usize) - ($base as usize)
71 /// Calculates the offset of the specified field from the start of the named struct.
95 /// specified `field` for a particular compilation, but the exact value may change
101 ($parent:path, $field:tt) => {{
104 // Get field pointer.
105 let field_ptr = raw_field!(base_ptr, $parent, $field);
111 /// Calculates the offset of the specified field from the start of the tuple.
124 ($parent:ty, $field:tt) => {{
127 // Get field pointer.
128 let field_ptr = raw_field_tuple!(base_ptr, $parent, $field);
152 /// Due to macro_rules limitations, this macro will accept structs with a single field as well as unions.
157 ($parent:path, $field:tt) => {{
160 // Get field pointer.
161 let field_ptr = raw_field_union!(base_ptr, $parent, $field);