@@ -202,7 +202,7 @@ fn bindgen_test_layout_ibv_wc() {
202
202
concat!( "Alignment of " , stringify!( ibv_wc) )
203
203
) ;
204
204
assert_eq ! (
205
- unsafe { & ( * ( 0 as * const ibv_wc) ) . wr_id as * const _ as usize } ,
205
+ std :: mem :: offset_of! ( ibv_wc, wr_id ) ,
206
206
0usize ,
207
207
concat!(
208
208
"Alignment of field: " ,
@@ -212,7 +212,7 @@ fn bindgen_test_layout_ibv_wc() {
212
212
)
213
213
) ;
214
214
assert_eq ! (
215
- unsafe { & ( * ( 0 as * const ibv_wc) ) . status as * const _ as usize } ,
215
+ std :: mem :: offset_of! ( ibv_wc, status ) ,
216
216
8usize ,
217
217
concat!(
218
218
"Alignment of field: " ,
@@ -222,7 +222,7 @@ fn bindgen_test_layout_ibv_wc() {
222
222
)
223
223
) ;
224
224
assert_eq ! (
225
- unsafe { & ( * ( 0 as * const ibv_wc) ) . opcode as * const _ as usize } ,
225
+ std :: mem :: offset_of! ( ibv_wc, opcode ) ,
226
226
12usize ,
227
227
concat!(
228
228
"Alignment of field: " ,
@@ -232,7 +232,7 @@ fn bindgen_test_layout_ibv_wc() {
232
232
)
233
233
) ;
234
234
assert_eq ! (
235
- unsafe { & ( * ( 0 as * const ibv_wc) ) . vendor_err as * const _ as usize } ,
235
+ std :: mem :: offset_of! ( ibv_wc, vendor_err ) ,
236
236
16usize ,
237
237
concat!(
238
238
"Alignment of field: " ,
@@ -242,7 +242,7 @@ fn bindgen_test_layout_ibv_wc() {
242
242
)
243
243
) ;
244
244
assert_eq ! (
245
- unsafe { & ( * ( 0 as * const ibv_wc) ) . byte_len as * const _ as usize } ,
245
+ std :: mem :: offset_of! ( ibv_wc, byte_len ) ,
246
246
20usize ,
247
247
concat!(
248
248
"Alignment of field: " ,
@@ -252,7 +252,7 @@ fn bindgen_test_layout_ibv_wc() {
252
252
)
253
253
) ;
254
254
assert_eq ! (
255
- unsafe { & ( * ( 0 as * const ibv_wc) ) . qp_num as * const _ as usize } ,
255
+ std :: mem :: offset_of! ( ibv_wc, qp_num ) ,
256
256
28usize ,
257
257
concat!(
258
258
"Alignment of field: " ,
@@ -262,7 +262,7 @@ fn bindgen_test_layout_ibv_wc() {
262
262
)
263
263
) ;
264
264
assert_eq ! (
265
- unsafe { & ( * ( 0 as * const ibv_wc) ) . src_qp as * const _ as usize } ,
265
+ std :: mem :: offset_of! ( ibv_wc, src_qp ) ,
266
266
32usize ,
267
267
concat!(
268
268
"Alignment of field: " ,
@@ -272,7 +272,7 @@ fn bindgen_test_layout_ibv_wc() {
272
272
)
273
273
) ;
274
274
assert_eq ! (
275
- unsafe { & ( * ( 0 as * const ibv_wc) ) . wc_flags as * const _ as usize } ,
275
+ std :: mem :: offset_of! ( ibv_wc, wc_flags ) ,
276
276
36usize ,
277
277
concat!(
278
278
"Alignment of field: " ,
@@ -282,7 +282,7 @@ fn bindgen_test_layout_ibv_wc() {
282
282
)
283
283
) ;
284
284
assert_eq ! (
285
- unsafe { & ( * ( 0 as * const ibv_wc) ) . pkey_index as * const _ as usize } ,
285
+ std :: mem :: offset_of! ( ibv_wc, pkey_index ) ,
286
286
40usize ,
287
287
concat!(
288
288
"Alignment of field: " ,
@@ -292,7 +292,7 @@ fn bindgen_test_layout_ibv_wc() {
292
292
)
293
293
) ;
294
294
assert_eq ! (
295
- unsafe { & ( * ( 0 as * const ibv_wc) ) . slid as * const _ as usize } ,
295
+ std :: mem :: offset_of! ( ibv_wc, slid ) ,
296
296
42usize ,
297
297
concat!(
298
298
"Alignment of field: " ,
@@ -302,7 +302,7 @@ fn bindgen_test_layout_ibv_wc() {
302
302
)
303
303
) ;
304
304
assert_eq ! (
305
- unsafe { & ( * ( 0 as * const ibv_wc) ) . sl as * const _ as usize } ,
305
+ std :: mem :: offset_of! ( ibv_wc, sl ) ,
306
306
44usize ,
307
307
concat!(
308
308
"Alignment of field: " ,
@@ -312,7 +312,7 @@ fn bindgen_test_layout_ibv_wc() {
312
312
)
313
313
) ;
314
314
assert_eq ! (
315
- unsafe { & ( * ( 0 as * const ibv_wc) ) . dlid_path_bits as * const _ as usize } ,
315
+ std :: mem :: offset_of! ( ibv_wc, dlid_path_bits ) ,
316
316
45usize ,
317
317
concat!(
318
318
"Alignment of field: " ,
0 commit comments