@@ -3393,7 +3393,7 @@ const FN_HEADER: hir::FnHeader = hir::FnHeader {
3393
3393
abi : rustc_target:: spec:: abi:: Abi :: Rust ,
3394
3394
} ;
3395
3395
3396
- struct ShouldImplTrait {
3396
+ struct ShouldImplTraitCase {
3397
3397
trait_name : & ' static str ,
3398
3398
method_name : & ' static str ,
3399
3399
param_count : usize ,
@@ -3405,7 +3405,7 @@ struct ShouldImplTrait {
3405
3405
// certain methods with explicit lifetimes can't implement the equivalent trait method
3406
3406
lint_explicit_lifetime : bool ,
3407
3407
}
3408
- impl ShouldImplTrait {
3408
+ impl ShouldImplTraitCase {
3409
3409
const fn new (
3410
3410
trait_name : & ' static str ,
3411
3411
method_name : & ' static str ,
@@ -3414,8 +3414,8 @@ impl ShouldImplTrait {
3414
3414
self_kind : SelfKind ,
3415
3415
output_type : OutType ,
3416
3416
lint_explicit_lifetime : bool ,
3417
- ) -> ShouldImplTrait {
3418
- ShouldImplTrait {
3417
+ ) -> ShouldImplTraitCase {
3418
+ ShouldImplTraitCase {
3419
3419
trait_name,
3420
3420
method_name,
3421
3421
param_count,
@@ -3440,38 +3440,38 @@ impl ShouldImplTrait {
3440
3440
}
3441
3441
3442
3442
#[ rustfmt:: skip]
3443
- const TRAIT_METHODS : [ ShouldImplTrait ; 30 ] = [
3444
- ShouldImplTrait :: new ( "std::ops::Add" , "add" , 2 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3445
- ShouldImplTrait :: new ( "std::convert::AsMut" , "as_mut" , 1 , & FN_HEADER , SelfKind :: RefMut , OutType :: Ref , true ) ,
3446
- ShouldImplTrait :: new ( "std::convert::AsRef" , "as_ref" , 1 , & FN_HEADER , SelfKind :: Ref , OutType :: Ref , true ) ,
3447
- ShouldImplTrait :: new ( "std::ops::BitAnd" , "bitand" , 2 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3448
- ShouldImplTrait :: new ( "std::ops::BitOr" , "bitor" , 2 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3449
- ShouldImplTrait :: new ( "std::ops::BitXor" , "bitxor" , 2 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3450
- ShouldImplTrait :: new ( "std::borrow::Borrow" , "borrow" , 1 , & FN_HEADER , SelfKind :: Ref , OutType :: Ref , true ) ,
3451
- ShouldImplTrait :: new ( "std::borrow::BorrowMut" , "borrow_mut" , 1 , & FN_HEADER , SelfKind :: RefMut , OutType :: Ref , true ) ,
3452
- ShouldImplTrait :: new ( "std::clone::Clone" , "clone" , 1 , & FN_HEADER , SelfKind :: Ref , OutType :: Any , true ) ,
3453
- ShouldImplTrait :: new ( "std::cmp::Ord" , "cmp" , 2 , & FN_HEADER , SelfKind :: Ref , OutType :: Any , true ) ,
3443
+ const TRAIT_METHODS : [ ShouldImplTraitCase ; 30 ] = [
3444
+ ShouldImplTraitCase :: new ( "std::ops::Add" , "add" , 2 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3445
+ ShouldImplTraitCase :: new ( "std::convert::AsMut" , "as_mut" , 1 , & FN_HEADER , SelfKind :: RefMut , OutType :: Ref , true ) ,
3446
+ ShouldImplTraitCase :: new ( "std::convert::AsRef" , "as_ref" , 1 , & FN_HEADER , SelfKind :: Ref , OutType :: Ref , true ) ,
3447
+ ShouldImplTraitCase :: new ( "std::ops::BitAnd" , "bitand" , 2 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3448
+ ShouldImplTraitCase :: new ( "std::ops::BitOr" , "bitor" , 2 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3449
+ ShouldImplTraitCase :: new ( "std::ops::BitXor" , "bitxor" , 2 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3450
+ ShouldImplTraitCase :: new ( "std::borrow::Borrow" , "borrow" , 1 , & FN_HEADER , SelfKind :: Ref , OutType :: Ref , true ) ,
3451
+ ShouldImplTraitCase :: new ( "std::borrow::BorrowMut" , "borrow_mut" , 1 , & FN_HEADER , SelfKind :: RefMut , OutType :: Ref , true ) ,
3452
+ ShouldImplTraitCase :: new ( "std::clone::Clone" , "clone" , 1 , & FN_HEADER , SelfKind :: Ref , OutType :: Any , true ) ,
3453
+ ShouldImplTraitCase :: new ( "std::cmp::Ord" , "cmp" , 2 , & FN_HEADER , SelfKind :: Ref , OutType :: Any , true ) ,
3454
3454
// FIXME: default doesn't work
3455
- ShouldImplTrait :: new ( "std::default::Default" , "default" , 0 , & FN_HEADER , SelfKind :: No , OutType :: Any , true ) ,
3456
- ShouldImplTrait :: new ( "std::ops::Deref" , "deref" , 1 , & FN_HEADER , SelfKind :: Ref , OutType :: Ref , true ) ,
3457
- ShouldImplTrait :: new ( "std::ops::DerefMut" , "deref_mut" , 1 , & FN_HEADER , SelfKind :: RefMut , OutType :: Ref , true ) ,
3458
- ShouldImplTrait :: new ( "std::ops::Div" , "div" , 2 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3459
- ShouldImplTrait :: new ( "std::ops::Drop" , "drop" , 1 , & FN_HEADER , SelfKind :: RefMut , OutType :: Unit , true ) ,
3460
- ShouldImplTrait :: new ( "std::cmp::PartialEq" , "eq" , 2 , & FN_HEADER , SelfKind :: Ref , OutType :: Bool , true ) ,
3461
- ShouldImplTrait :: new ( "std::iter::FromIterator" , "from_iter" , 1 , & FN_HEADER , SelfKind :: No , OutType :: Any , true ) ,
3462
- ShouldImplTrait :: new ( "std::str::FromStr" , "from_str" , 1 , & FN_HEADER , SelfKind :: No , OutType :: Any , true ) ,
3463
- ShouldImplTrait :: new ( "std::hash::Hash" , "hash" , 2 , & FN_HEADER , SelfKind :: Ref , OutType :: Unit , true ) ,
3464
- ShouldImplTrait :: new ( "std::ops::Index" , "index" , 2 , & FN_HEADER , SelfKind :: Ref , OutType :: Ref , true ) ,
3465
- ShouldImplTrait :: new ( "std::ops::IndexMut" , "index_mut" , 2 , & FN_HEADER , SelfKind :: RefMut , OutType :: Ref , true ) ,
3466
- ShouldImplTrait :: new ( "std::iter::IntoIterator" , "into_iter" , 1 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3467
- ShouldImplTrait :: new ( "std::ops::Mul" , "mul" , 2 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3468
- ShouldImplTrait :: new ( "std::ops::Neg" , "neg" , 1 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3469
- ShouldImplTrait :: new ( "std::iter::Iterator" , "next" , 1 , & FN_HEADER , SelfKind :: RefMut , OutType :: Any , false ) ,
3470
- ShouldImplTrait :: new ( "std::ops::Not" , "not" , 1 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3471
- ShouldImplTrait :: new ( "std::ops::Rem" , "rem" , 2 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3472
- ShouldImplTrait :: new ( "std::ops::Shl" , "shl" , 2 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3473
- ShouldImplTrait :: new ( "std::ops::Shr" , "shr" , 2 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3474
- ShouldImplTrait :: new ( "std::ops::Sub" , "sub" , 2 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3455
+ ShouldImplTraitCase :: new ( "std::default::Default" , "default" , 0 , & FN_HEADER , SelfKind :: No , OutType :: Any , true ) ,
3456
+ ShouldImplTraitCase :: new ( "std::ops::Deref" , "deref" , 1 , & FN_HEADER , SelfKind :: Ref , OutType :: Ref , true ) ,
3457
+ ShouldImplTraitCase :: new ( "std::ops::DerefMut" , "deref_mut" , 1 , & FN_HEADER , SelfKind :: RefMut , OutType :: Ref , true ) ,
3458
+ ShouldImplTraitCase :: new ( "std::ops::Div" , "div" , 2 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3459
+ ShouldImplTraitCase :: new ( "std::ops::Drop" , "drop" , 1 , & FN_HEADER , SelfKind :: RefMut , OutType :: Unit , true ) ,
3460
+ ShouldImplTraitCase :: new ( "std::cmp::PartialEq" , "eq" , 2 , & FN_HEADER , SelfKind :: Ref , OutType :: Bool , true ) ,
3461
+ ShouldImplTraitCase :: new ( "std::iter::FromIterator" , "from_iter" , 1 , & FN_HEADER , SelfKind :: No , OutType :: Any , true ) ,
3462
+ ShouldImplTraitCase :: new ( "std::str::FromStr" , "from_str" , 1 , & FN_HEADER , SelfKind :: No , OutType :: Any , true ) ,
3463
+ ShouldImplTraitCase :: new ( "std::hash::Hash" , "hash" , 2 , & FN_HEADER , SelfKind :: Ref , OutType :: Unit , true ) ,
3464
+ ShouldImplTraitCase :: new ( "std::ops::Index" , "index" , 2 , & FN_HEADER , SelfKind :: Ref , OutType :: Ref , true ) ,
3465
+ ShouldImplTraitCase :: new ( "std::ops::IndexMut" , "index_mut" , 2 , & FN_HEADER , SelfKind :: RefMut , OutType :: Ref , true ) ,
3466
+ ShouldImplTraitCase :: new ( "std::iter::IntoIterator" , "into_iter" , 1 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3467
+ ShouldImplTraitCase :: new ( "std::ops::Mul" , "mul" , 2 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3468
+ ShouldImplTraitCase :: new ( "std::ops::Neg" , "neg" , 1 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3469
+ ShouldImplTraitCase :: new ( "std::iter::Iterator" , "next" , 1 , & FN_HEADER , SelfKind :: RefMut , OutType :: Any , false ) ,
3470
+ ShouldImplTraitCase :: new ( "std::ops::Not" , "not" , 1 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3471
+ ShouldImplTraitCase :: new ( "std::ops::Rem" , "rem" , 2 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3472
+ ShouldImplTraitCase :: new ( "std::ops::Shl" , "shl" , 2 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3473
+ ShouldImplTraitCase :: new ( "std::ops::Shr" , "shr" , 2 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3474
+ ShouldImplTraitCase :: new ( "std::ops::Sub" , "sub" , 2 , & FN_HEADER , SelfKind :: Value , OutType :: Any , true ) ,
3475
3475
] ;
3476
3476
3477
3477
#[ rustfmt:: skip]
0 commit comments