@@ -342,19 +342,16 @@ s! {
342
342
343
343
s_no_extra_traits ! {
344
344
#[ cfg_attr( any( target_arch = "x86" , target_arch = "x86_64" ) , repr( packed) ) ]
345
- #[ allow( missing_debug_implementations) ]
346
345
pub struct epoll_event {
347
346
pub events: :: uint32_t,
348
347
pub u64 : :: uint64_t,
349
348
}
350
349
351
- #[ allow( missing_debug_implementations) ]
352
350
pub struct sockaddr_un {
353
351
pub sun_family: sa_family_t,
354
352
pub sun_path: [ c_char; 108 ]
355
353
}
356
354
357
- #[ allow( missing_debug_implementations) ]
358
355
pub struct utsname {
359
356
pub sysname: [ :: c_char; 257 ] ,
360
357
pub nodename: [ :: c_char; 257 ] ,
@@ -363,23 +360,20 @@ s_no_extra_traits! {
363
360
pub machine: [ :: c_char; 257 ] ,
364
361
}
365
362
366
- #[ allow( missing_debug_implementations) ]
367
363
pub struct fd_set {
368
364
#[ cfg( target_pointer_width = "64" ) ]
369
365
fds_bits: [ i64 ; FD_SETSIZE / 64 ] ,
370
366
#[ cfg( target_pointer_width = "32" ) ]
371
367
fds_bits: [ i32 ; FD_SETSIZE / 32 ] ,
372
368
}
373
369
374
- #[ allow( missing_debug_implementations) ]
375
370
pub struct sockaddr_storage {
376
371
pub ss_family: :: sa_family_t,
377
372
__ss_pad1: [ u8 ; 6 ] ,
378
373
__ss_align: i64 ,
379
374
__ss_pad2: [ u8 ; 240 ] ,
380
375
}
381
376
382
- #[ allow( missing_debug_implementations) ]
383
377
pub struct siginfo_t {
384
378
pub si_signo: :: c_int,
385
379
pub si_code: :: c_int,
@@ -389,7 +383,6 @@ s_no_extra_traits! {
389
383
__pad: [ u8 ; 232 ] ,
390
384
}
391
385
392
- #[ allow( missing_debug_implementations) ]
393
386
pub struct sockaddr_dl {
394
387
pub sdl_family: :: c_ushort,
395
388
pub sdl_index: :: c_ushort,
@@ -401,6 +394,239 @@ s_no_extra_traits! {
401
394
}
402
395
}
403
396
397
+ cfg_if ! {
398
+ if #[ cfg( feature = "extra_traits" ) ] {
399
+ impl PartialEq for epoll_event {
400
+ fn eq( & self , other: & epoll_event) -> bool {
401
+ self . events == other. events
402
+ && self . u64 == other. u64
403
+ }
404
+ }
405
+ impl Eq for epoll_event { }
406
+ impl :: fmt:: Debug for epoll_event {
407
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
408
+ f. debug_struct( "epoll_event" )
409
+ . field( "events" , unsafe { & self . events } )
410
+ . field( "u64" , unsafe { & self . u64 } )
411
+ . finish( )
412
+ }
413
+ }
414
+ impl :: hash:: Hash for epoll_event {
415
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
416
+ unsafe {
417
+ self . events. hash( state) ;
418
+ self . u64 . hash( state) ;
419
+ }
420
+ }
421
+ }
422
+
423
+ impl PartialEq for sockaddr_un {
424
+ fn eq( & self , other: & sockaddr_un) -> bool {
425
+ self . sun_family == other. sun_family
426
+ && self
427
+ . sun_path
428
+ . iter( )
429
+ . zip( other. sun_path. iter( ) )
430
+ . all( |( a, b) | a == b)
431
+ }
432
+ }
433
+ impl Eq for sockaddr_un { }
434
+ impl :: fmt:: Debug for sockaddr_un {
435
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
436
+ f. debug_struct( "sockaddr_un" )
437
+ . field( "sun_family" , & self . sun_family)
438
+ // FIXME: .field("sun_path", &self.sun_path)
439
+ . finish( )
440
+ }
441
+ }
442
+ impl :: hash:: Hash for sockaddr_un {
443
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
444
+ self . sun_family. hash( state) ;
445
+ self . sun_path. hash( state) ;
446
+ }
447
+ }
448
+
449
+ impl PartialEq for utsname {
450
+ fn eq( & self , other: & utsname) -> bool {
451
+ self . sysname
452
+ . iter( )
453
+ . zip( other. sysname. iter( ) )
454
+ . all( |( a, b) | a == b)
455
+ && self
456
+ . nodename
457
+ . iter( )
458
+ . zip( other. nodename. iter( ) )
459
+ . all( |( a, b) | a == b)
460
+ && self
461
+ . release
462
+ . iter( )
463
+ . zip( other. release. iter( ) )
464
+ . all( |( a, b) | a == b)
465
+ && self
466
+ . version
467
+ . iter( )
468
+ . zip( other. version. iter( ) )
469
+ . all( |( a, b) | a == b)
470
+ && self
471
+ . machine
472
+ . iter( )
473
+ . zip( other. machine. iter( ) )
474
+ . all( |( a, b) | a == b)
475
+ }
476
+ }
477
+ impl Eq for utsname { }
478
+ impl :: fmt:: Debug for utsname {
479
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
480
+ f. debug_struct( "utsname" )
481
+ // FIXME: .field("sysname", &self.sysname)
482
+ // FIXME: .field("nodename", &self.nodename)
483
+ // FIXME: .field("release", &self.release)
484
+ // FIXME: .field("version", &self.version)
485
+ // FIXME: .field("machine", &self.machine)
486
+ . finish( )
487
+ }
488
+ }
489
+ impl :: hash:: Hash for utsname {
490
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
491
+ self . sysname. hash( state) ;
492
+ self . nodename. hash( state) ;
493
+ self . release. hash( state) ;
494
+ self . version. hash( state) ;
495
+ self . machine. hash( state) ;
496
+ }
497
+ }
498
+
499
+ impl PartialEq for fd_set {
500
+ fn eq( & self , other: & fd_set) -> bool {
501
+ self . fds_bits
502
+ . iter( )
503
+ . zip( other. fds_bits. iter( ) )
504
+ }
505
+ }
506
+ impl Eq for fd_set { }
507
+ impl :: fmt:: Debug for fd_set {
508
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
509
+ f. debug_struct( "fd_set" )
510
+ // FIXME: .field("fds_bits", &self.fds_bits)
511
+ . finish( )
512
+ }
513
+ }
514
+ impl :: hash:: Hash for fd_set {
515
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
516
+ self . fds_bits. hash( state) ;
517
+ }
518
+ }
519
+
520
+ impl PartialEq for sockaddr_storage {
521
+ fn eq( & self , other: & sockaddr_storage) -> bool {
522
+ self . ss_family == other. ss_family
523
+ && self . __ss_pad1 == other. __ss_pad1
524
+ && self . __ss_align == other. __ss_align
525
+ && self
526
+ . __ss_pad2
527
+ . iter( )
528
+ . zip( other. __ss_pad2. iter( ) )
529
+ . all( |( a, b) | a == b)
530
+ }
531
+ }
532
+ impl Eq for sockaddr_storage { }
533
+ impl :: fmt:: Debug for sockaddr_storage {
534
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
535
+ f. debug_struct( "sockaddr_storage" )
536
+ . field( "ss_family" , & self . ss_family)
537
+ . field( "__ss_pad1" , & self . __ss_pad1)
538
+ . field( "__ss_align" , & self . __ss_align)
539
+ // FIXME: .field("__ss_pad2", &self.__ss_pad2)
540
+ . finish( )
541
+ }
542
+ }
543
+ impl :: hash:: Hash for sockaddr_storage {
544
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
545
+ self . ss_family. hash( state) ;
546
+ self . __ss_pad1. hash( state) ;
547
+ self . __ss_align. hash( state) ;
548
+ self . __ss_pad2. hash( state) ;
549
+ }
550
+ }
551
+
552
+ impl PartialEq for siginfo_t {
553
+ fn eq( & self , other: & siginfo_t) -> bool {
554
+ self . si_signo == other. si_signo
555
+ && self . si_code == other. si_code
556
+ && self . si_errno == other. si_errno
557
+ && self . si_addr == other. si_addr
558
+ && self
559
+ . __pad
560
+ . iter( )
561
+ . zip( other. __pad. iter( ) )
562
+ . all( |( a, b) | a == b)
563
+ }
564
+ }
565
+ impl Eq for siginfo_t { }
566
+ impl :: fmt:: Debug for siginfo_t {
567
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
568
+ f. debug_struct( "siginfo_t" )
569
+ . field( "si_signo" , & self . si_signo)
570
+ . field( "si_code" , & self . si_code)
571
+ . field( "si_errno" , & self . si_errno)
572
+ . field( "si_addr" , & self . si_addr)
573
+ // FIXME: .field("__pad", &self.__pad)
574
+ . finish( )
575
+ }
576
+ }
577
+ impl :: hash:: Hash for siginfo_t {
578
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
579
+ self . si_signo. hash( state) ;
580
+ self . si_code. hash( state) ;
581
+ self . si_errno. hash( state) ;
582
+ self . si_addr. hash( state) ;
583
+ self . __pad. hash( state) ;
584
+ }
585
+ }
586
+
587
+ impl PartialEq for sockaddr_dl {
588
+ fn eq( & self , other: & sockaddr_dl) -> bool {
589
+ self . sdl_family == other. sdl_family
590
+ && self . sdl_index == other. sdl_index
591
+ && self . sdl_type == other. sdl_type
592
+ && self . sdl_nlen == other. sdl_nlen
593
+ && self . sdl_alen == other. sdl_alen
594
+ && self . sdl_slen == other. sdl_slen
595
+ && self
596
+ . sdl_data
597
+ . iter( )
598
+ . zip( other. sdl_data. iter( ) )
599
+ . all( |( a, b) | a == b)
600
+ }
601
+ }
602
+ impl Eq for sockaddr_dl { }
603
+ impl :: fmt:: Debug for sockaddr_dl {
604
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
605
+ f. debug_struct( "sockaddr_dl" )
606
+ . field( "sdl_family" , & self . sdl_family)
607
+ . field( "sdl_index" , & self . sdl_index)
608
+ . field( "sdl_type" , & self . sdl_type)
609
+ . field( "sdl_nlen" , & self . sdl_nlen)
610
+ . field( "sdl_alen" , & self . sdl_alen)
611
+ . field( "sdl_slen" , & self . sdl_slen)
612
+ // FIXME: .field("sdl_data", &self.sdl_data)
613
+ . finish( )
614
+ }
615
+ }
616
+ impl :: hash:: Hash for sockaddr_dl {
617
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
618
+ self . sdl_family. hash( state) ;
619
+ self . sdl_index. hash( state) ;
620
+ self . sdl_type. hash( state) ;
621
+ self . sdl_nlen. hash( state) ;
622
+ self . sdl_alen. hash( state) ;
623
+ self . sdl_slen. hash( state) ;
624
+ self . sdl_data. hash( state) ;
625
+ }
626
+ }
627
+ }
628
+ }
629
+
404
630
pub const LC_CTYPE : :: c_int = 0 ;
405
631
pub const LC_NUMERIC : :: c_int = 1 ;
406
632
pub const LC_TIME : :: c_int = 2 ;
0 commit comments