Lines Matching defs:offset_of
75 /// use memoffset::offset_of;
85 /// assert_eq!(offset_of!(Foo, a), 0);
86 /// assert_eq!(offset_of!(Foo, b), 4);
94 /// Using `offset_of!` with a `repr(Rust)` struct will return the correct offset of the
100 macro_rules! offset_of {
178 assert_eq!(offset_of!(Foo, a), 0);
179 assert_eq!(offset_of!(Foo, b), 4);
180 assert_eq!(offset_of!(Foo, c), 8);
193 assert_eq!(offset_of!(Foo, a), 0);
194 assert_eq!(offset_of!(Foo, b), 4);
195 assert_eq!(offset_of!(Foo, c), 6);
203 assert_eq!(offset_of!(Tup, 0), 0);
204 assert_eq!(offset_of!(Tup, 1), 4);
231 assert_eq!(offset_of!(sub::Foo, x), 0);
239 offset_of!(Pair<T, U>, 1)
325 assert_eq!([0; offset_of!(Foo, b)].len(), 4);
337 assert_eq!([0; offset_of!(Foo, b)].len(), 4);
351 offset_of!(Foo, b)