about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-10-13 09:31:22 -0400
committerMichael Goulet <michael@errs.io>2024-10-14 09:20:38 -0400
commit5aa3e115f6bcd9f791cef1cd4ec1860a7fec4f02 (patch)
treee3b0c308b52d88a40354c505c2bbae867f2ab3e1
parent360d86e9ec4153349fbf7ee8828626cc3cefbe25 (diff)
downloadrust-5aa3e115f6bcd9f791cef1cd4ec1860a7fec4f02.tar.gz
rust-5aa3e115f6bcd9f791cef1cd4ec1860a7fec4f02.zip
Move trait bound modifiers into ast::PolyTraitRef
-rw-r--r--clippy_utils/src/ast_utils.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/clippy_utils/src/ast_utils.rs b/clippy_utils/src/ast_utils.rs
index 68f74e52ed7..31585698475 100644
--- a/clippy_utils/src/ast_utils.rs
+++ b/clippy_utils/src/ast_utils.rs
@@ -783,7 +783,8 @@ pub fn eq_str_lit(l: &StrLit, r: &StrLit) -> bool {
 }
 
 pub fn eq_poly_ref_trait(l: &PolyTraitRef, r: &PolyTraitRef) -> bool {
-    eq_path(&l.trait_ref.path, &r.trait_ref.path)
+    l.modifiers == r.modifiers
+        && eq_path(&l.trait_ref.path, &r.trait_ref.path)
         && over(&l.bound_generic_params, &r.bound_generic_params, |l, r| {
             eq_generic_param(l, r)
         })
@@ -817,7 +818,7 @@ pub fn eq_generic_param(l: &GenericParam, r: &GenericParam) -> bool {
 pub fn eq_generic_bound(l: &GenericBound, r: &GenericBound) -> bool {
     use GenericBound::*;
     match (l, r) {
-        (Trait(ptr1, tbm1), Trait(ptr2, tbm2)) => tbm1 == tbm2 && eq_poly_ref_trait(ptr1, ptr2),
+        (Trait(ptr1), Trait(ptr2)) => eq_poly_ref_trait(ptr1, ptr2),
         (Outlives(l), Outlives(r)) => eq_id(l.ident, r.ident),
         _ => false,
     }