@@ -3425,12 +3425,12 @@ enum SelfKind {
3425
3425
3426
3426
impl SelfKind {
3427
3427
fn matches < ' a > ( self , cx : & LateContext < ' _ , ' a > , parent_ty : Ty < ' a > , ty : Ty < ' a > ) -> bool {
3428
- fn matches_value ( parent_ty : Ty < ' _ > , ty : Ty < ' _ > ) -> bool {
3428
+ fn matches_value < ' a > ( cx : & LateContext < ' _ , ' a > , parent_ty : Ty < ' _ > , ty : Ty < ' _ > ) -> bool {
3429
3429
if ty == parent_ty {
3430
3430
true
3431
3431
} else if ty. is_box ( ) {
3432
3432
ty. boxed_ty ( ) == parent_ty
3433
- } else if ty . is_rc ( ) || ty . is_arc ( ) {
3433
+ } else if is_type_diagnostic_item ( cx , ty , sym :: Rc ) || is_type_diagnostic_item ( cx , ty , sym :: Arc ) {
3434
3434
if let ty:: Adt ( _, substs) = ty. kind {
3435
3435
substs. types ( ) . next ( ) . map_or ( false , |t| t == parent_ty)
3436
3436
} else {
@@ -3464,7 +3464,7 @@ impl SelfKind {
3464
3464
}
3465
3465
3466
3466
match self {
3467
- Self :: Value => matches_value ( parent_ty, ty) ,
3467
+ Self :: Value => matches_value ( cx , parent_ty, ty) ,
3468
3468
Self :: Ref => matches_ref ( cx, hir:: Mutability :: Not , parent_ty, ty) || ty == parent_ty && is_copy ( cx, ty) ,
3469
3469
Self :: RefMut => matches_ref ( cx, hir:: Mutability :: Mut , parent_ty, ty) ,
3470
3470
Self :: No => ty != parent_ty,
0 commit comments