@@ -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,242 @@ 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
+ let events = self . events;
409
+ let u64 = self . u64 ;
410
+ f. debug_struct( "epoll_event" )
411
+ . field( "events" , & events)
412
+ . field( "u64" , & u64 )
413
+ . finish( )
414
+ }
415
+ }
416
+ impl :: hash:: Hash for epoll_event {
417
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
418
+ let events = self . events;
419
+ let u64 = self . u64 ;
420
+ events. hash( state) ;
421
+ u64 . hash( state) ;
422
+ }
423
+ }
424
+
425
+ impl PartialEq for sockaddr_un {
426
+ fn eq( & self , other: & sockaddr_un) -> bool {
427
+ self . sun_family == other. sun_family
428
+ && self
429
+ . sun_path
430
+ . iter( )
431
+ . zip( other. sun_path. iter( ) )
432
+ . all( |( a, b) | a == b)
433
+ }
434
+ }
435
+ impl Eq for sockaddr_un { }
436
+ impl :: fmt:: Debug for sockaddr_un {
437
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
438
+ f. debug_struct( "sockaddr_un" )
439
+ . field( "sun_family" , & self . sun_family)
440
+ // FIXME: .field("sun_path", &self.sun_path)
441
+ . finish( )
442
+ }
443
+ }
444
+ impl :: hash:: Hash for sockaddr_un {
445
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
446
+ self . sun_family. hash( state) ;
447
+ self . sun_path. hash( state) ;
448
+ }
449
+ }
450
+
451
+ impl PartialEq for utsname {
452
+ fn eq( & self , other: & utsname) -> bool {
453
+ self . sysname
454
+ . iter( )
455
+ . zip( other. sysname. iter( ) )
456
+ . all( |( a, b) | a == b)
457
+ && self
458
+ . nodename
459
+ . iter( )
460
+ . zip( other. nodename. iter( ) )
461
+ . all( |( a, b) | a == b)
462
+ && self
463
+ . release
464
+ . iter( )
465
+ . zip( other. release. iter( ) )
466
+ . all( |( a, b) | a == b)
467
+ && self
468
+ . version
469
+ . iter( )
470
+ . zip( other. version. iter( ) )
471
+ . all( |( a, b) | a == b)
472
+ && self
473
+ . machine
474
+ . iter( )
475
+ . zip( other. machine. iter( ) )
476
+ . all( |( a, b) | a == b)
477
+ }
478
+ }
479
+ impl Eq for utsname { }
480
+ impl :: fmt:: Debug for utsname {
481
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
482
+ f. debug_struct( "utsname" )
483
+ // FIXME: .field("sysname", &self.sysname)
484
+ // FIXME: .field("nodename", &self.nodename)
485
+ // FIXME: .field("release", &self.release)
486
+ // FIXME: .field("version", &self.version)
487
+ // FIXME: .field("machine", &self.machine)
488
+ . finish( )
489
+ }
490
+ }
491
+ impl :: hash:: Hash for utsname {
492
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
493
+ self . sysname. hash( state) ;
494
+ self . nodename. hash( state) ;
495
+ self . release. hash( state) ;
496
+ self . version. hash( state) ;
497
+ self . machine. hash( state) ;
498
+ }
499
+ }
500
+
501
+ impl PartialEq for fd_set {
502
+ fn eq( & self , other: & fd_set) -> bool {
503
+ self . fds_bits
504
+ . iter( )
505
+ . zip( other. fds_bits. iter( ) )
506
+ . all( |( a, b) | a == b)
507
+ }
508
+ }
509
+ impl Eq for fd_set { }
510
+ impl :: fmt:: Debug for fd_set {
511
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
512
+ f. debug_struct( "fd_set" )
513
+ // FIXME: .field("fds_bits", &self.fds_bits)
514
+ . finish( )
515
+ }
516
+ }
517
+ impl :: hash:: Hash for fd_set {
518
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
519
+ self . fds_bits. hash( state) ;
520
+ }
521
+ }
522
+
523
+ impl PartialEq for sockaddr_storage {
524
+ fn eq( & self , other: & sockaddr_storage) -> bool {
525
+ self . ss_family == other. ss_family
526
+ && self . __ss_pad1 == other. __ss_pad1
527
+ && self . __ss_align == other. __ss_align
528
+ && self
529
+ . __ss_pad2
530
+ . iter( )
531
+ . zip( other. __ss_pad2. iter( ) )
532
+ . all( |( a, b) | a == b)
533
+ }
534
+ }
535
+ impl Eq for sockaddr_storage { }
536
+ impl :: fmt:: Debug for sockaddr_storage {
537
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
538
+ f. debug_struct( "sockaddr_storage" )
539
+ . field( "ss_family" , & self . ss_family)
540
+ . field( "__ss_pad1" , & self . __ss_pad1)
541
+ . field( "__ss_align" , & self . __ss_align)
542
+ // FIXME: .field("__ss_pad2", &self.__ss_pad2)
543
+ . finish( )
544
+ }
545
+ }
546
+ impl :: hash:: Hash for sockaddr_storage {
547
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
548
+ self . ss_family. hash( state) ;
549
+ self . __ss_pad1. hash( state) ;
550
+ self . __ss_align. hash( state) ;
551
+ self . __ss_pad2. hash( state) ;
552
+ }
553
+ }
554
+
555
+ impl PartialEq for siginfo_t {
556
+ fn eq( & self , other: & siginfo_t) -> bool {
557
+ self . si_signo == other. si_signo
558
+ && self . si_code == other. si_code
559
+ && self . si_errno == other. si_errno
560
+ && self . si_addr == other. si_addr
561
+ && self
562
+ . __pad
563
+ . iter( )
564
+ . zip( other. __pad. iter( ) )
565
+ . all( |( a, b) | a == b)
566
+ }
567
+ }
568
+ impl Eq for siginfo_t { }
569
+ impl :: fmt:: Debug for siginfo_t {
570
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
571
+ f. debug_struct( "siginfo_t" )
572
+ . field( "si_signo" , & self . si_signo)
573
+ . field( "si_code" , & self . si_code)
574
+ . field( "si_errno" , & self . si_errno)
575
+ . field( "si_addr" , & self . si_addr)
576
+ // FIXME: .field("__pad", &self.__pad)
577
+ . finish( )
578
+ }
579
+ }
580
+ impl :: hash:: Hash for siginfo_t {
581
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
582
+ self . si_signo. hash( state) ;
583
+ self . si_code. hash( state) ;
584
+ self . si_errno. hash( state) ;
585
+ self . si_addr. hash( state) ;
586
+ self . __pad. hash( state) ;
587
+ }
588
+ }
589
+
590
+ impl PartialEq for sockaddr_dl {
591
+ fn eq( & self , other: & sockaddr_dl) -> bool {
592
+ self . sdl_family == other. sdl_family
593
+ && self . sdl_index == other. sdl_index
594
+ && self . sdl_type == other. sdl_type
595
+ && self . sdl_nlen == other. sdl_nlen
596
+ && self . sdl_alen == other. sdl_alen
597
+ && self . sdl_slen == other. sdl_slen
598
+ && self
599
+ . sdl_data
600
+ . iter( )
601
+ . zip( other. sdl_data. iter( ) )
602
+ . all( |( a, b) | a == b)
603
+ }
604
+ }
605
+ impl Eq for sockaddr_dl { }
606
+ impl :: fmt:: Debug for sockaddr_dl {
607
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
608
+ f. debug_struct( "sockaddr_dl" )
609
+ . field( "sdl_family" , & self . sdl_family)
610
+ . field( "sdl_index" , & self . sdl_index)
611
+ . field( "sdl_type" , & self . sdl_type)
612
+ . field( "sdl_nlen" , & self . sdl_nlen)
613
+ . field( "sdl_alen" , & self . sdl_alen)
614
+ . field( "sdl_slen" , & self . sdl_slen)
615
+ // FIXME: .field("sdl_data", &self.sdl_data)
616
+ . finish( )
617
+ }
618
+ }
619
+ impl :: hash:: Hash for sockaddr_dl {
620
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
621
+ self . sdl_family. hash( state) ;
622
+ self . sdl_index. hash( state) ;
623
+ self . sdl_type. hash( state) ;
624
+ self . sdl_nlen. hash( state) ;
625
+ self . sdl_alen. hash( state) ;
626
+ self . sdl_slen. hash( state) ;
627
+ self . sdl_data. hash( state) ;
628
+ }
629
+ }
630
+ }
631
+ }
632
+
404
633
pub const LC_CTYPE : :: c_int = 0 ;
405
634
pub const LC_NUMERIC : :: c_int = 1 ;
406
635
pub const LC_TIME : :: c_int = 2 ;
0 commit comments