@@ -451,7 +451,7 @@ impl CannotDerive<'_> {
451
451
}
452
452
453
453
impl DeriveTrait {
454
- fn not_by_name ( & self , ctx : & BindgenContext , item : & Item ) -> bool {
454
+ fn not_by_name ( self , ctx : & BindgenContext , item : & Item ) -> bool {
455
455
match self {
456
456
DeriveTrait :: Copy => ctx. no_copy_by_name ( item) ,
457
457
DeriveTrait :: Debug => ctx. no_debug_by_name ( item) ,
@@ -463,21 +463,21 @@ impl DeriveTrait {
463
463
}
464
464
}
465
465
466
- fn consider_edge_comp ( & self ) -> EdgePredicate {
466
+ fn consider_edge_comp ( self ) -> EdgePredicate {
467
467
match self {
468
468
DeriveTrait :: PartialEqOrPartialOrd => consider_edge_default,
469
469
_ => |kind| matches ! ( kind, EdgeKind :: BaseMember | EdgeKind :: Field ) ,
470
470
}
471
471
}
472
472
473
- fn consider_edge_typeref ( & self ) -> EdgePredicate {
473
+ fn consider_edge_typeref ( self ) -> EdgePredicate {
474
474
match self {
475
475
DeriveTrait :: PartialEqOrPartialOrd => consider_edge_default,
476
476
_ => |kind| kind == EdgeKind :: TypeReference ,
477
477
}
478
478
}
479
479
480
- fn consider_edge_tmpl_inst ( & self ) -> EdgePredicate {
480
+ fn consider_edge_tmpl_inst ( self ) -> EdgePredicate {
481
481
match self {
482
482
DeriveTrait :: PartialEqOrPartialOrd => consider_edge_default,
483
483
_ => |kind| {
@@ -489,31 +489,31 @@ impl DeriveTrait {
489
489
}
490
490
}
491
491
492
- fn can_derive_large_array ( & self , ctx : & BindgenContext ) -> bool {
492
+ fn can_derive_large_array ( self , ctx : & BindgenContext ) -> bool {
493
493
if ctx. options ( ) . rust_features ( ) . larger_arrays {
494
494
!matches ! ( self , DeriveTrait :: Default )
495
495
} else {
496
496
matches ! ( self , DeriveTrait :: Copy )
497
497
}
498
498
}
499
499
500
- fn can_derive_union ( & self ) -> bool {
500
+ fn can_derive_union ( self ) -> bool {
501
501
matches ! ( self , DeriveTrait :: Copy )
502
502
}
503
503
504
- fn can_derive_compound_with_destructor ( & self ) -> bool {
504
+ fn can_derive_compound_with_destructor ( self ) -> bool {
505
505
!matches ! ( self , DeriveTrait :: Copy )
506
506
}
507
507
508
- fn can_derive_compound_with_vtable ( & self ) -> bool {
508
+ fn can_derive_compound_with_vtable ( self ) -> bool {
509
509
!matches ! ( self , DeriveTrait :: Default )
510
510
}
511
511
512
- fn can_derive_compound_forward_decl ( & self ) -> bool {
512
+ fn can_derive_compound_forward_decl ( self ) -> bool {
513
513
matches ! ( self , DeriveTrait :: Copy | DeriveTrait :: Debug )
514
514
}
515
515
516
- fn can_derive_incomplete_array ( & self ) -> bool {
516
+ fn can_derive_incomplete_array ( self ) -> bool {
517
517
!matches ! (
518
518
self ,
519
519
DeriveTrait :: Copy |
@@ -522,7 +522,7 @@ impl DeriveTrait {
522
522
)
523
523
}
524
524
525
- fn can_derive_fnptr ( & self , f : & FunctionSig ) -> CanDerive {
525
+ fn can_derive_fnptr ( self , f : & FunctionSig ) -> CanDerive {
526
526
match ( self , f. function_pointers_can_derive ( ) ) {
527
527
( DeriveTrait :: Copy | DeriveTrait :: Default , _) | ( _, true ) => {
528
528
trace ! ( " function pointer can derive {self}" ) ;
@@ -539,8 +539,8 @@ impl DeriveTrait {
539
539
}
540
540
}
541
541
542
- fn can_derive_vector ( & self ) -> CanDerive {
543
- if * self == DeriveTrait :: PartialEqOrPartialOrd {
542
+ fn can_derive_vector ( self ) -> CanDerive {
543
+ if self == DeriveTrait :: PartialEqOrPartialOrd {
544
544
// FIXME: vectors always can derive PartialEq, but they should
545
545
// not derive PartialOrd:
546
546
// https://github.com/rust-lang-nursery/packed_simd/issues/48
@@ -552,8 +552,8 @@ impl DeriveTrait {
552
552
}
553
553
}
554
554
555
- fn can_derive_pointer ( & self ) -> CanDerive {
556
- if * self == DeriveTrait :: Default {
555
+ fn can_derive_pointer ( self ) -> CanDerive {
556
+ if self == DeriveTrait :: Default {
557
557
trace ! ( " pointer cannot derive Default" ) ;
558
558
CanDerive :: No
559
559
} else {
@@ -562,7 +562,7 @@ impl DeriveTrait {
562
562
}
563
563
}
564
564
565
- fn can_derive_simple ( & self , kind : & TypeKind ) -> CanDerive {
565
+ fn can_derive_simple ( self , kind : & TypeKind ) -> CanDerive {
566
566
match ( self , kind) {
567
567
// === Default ===
568
568
(
0 commit comments