about summary refs log tree commit diff
path: root/compiler/rustc_builtin_macros/src/autodiff.rs
diff options
context:
space:
mode:
authorYotam Ofek <yotam.ofek@gmail.com>2025-09-27 20:57:50 +0300
committerYotam Ofek <yotam.ofek@gmail.com>2025-09-29 08:08:05 +0300
commit68a7c250788833305f73f816b284aafa9e62370a (patch)
treefc0eef15595f8d6272d6508ddbfe9c31c3fa5175 /compiler/rustc_builtin_macros/src/autodiff.rs
parentf957826bff7a68b267ce75b1ea56352aed0cca0a (diff)
downloadrust-68a7c250788833305f73f816b284aafa9e62370a.tar.gz
rust-68a7c250788833305f73f816b284aafa9e62370a.zip
Use `Iterator::eq` and (dogfood) `eq_by` in compiler and library
Diffstat (limited to 'compiler/rustc_builtin_macros/src/autodiff.rs')
-rw-r--r--compiler/rustc_builtin_macros/src/autodiff.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_builtin_macros/src/autodiff.rs b/compiler/rustc_builtin_macros/src/autodiff.rs
index f4a923797e2..ddc59bfe141 100644
--- a/compiler/rustc_builtin_macros/src/autodiff.rs
+++ b/compiler/rustc_builtin_macros/src/autodiff.rs
@@ -377,8 +377,7 @@ mod llvm_enzyme {
                 (ast::AttrKind::Normal(a), ast::AttrKind::Normal(b)) => {
                     let a = &a.item.path;
                     let b = &b.item.path;
-                    a.segments.len() == b.segments.len()
-                        && a.segments.iter().zip(b.segments.iter()).all(|(a, b)| a.ident == b.ident)
+                    a.segments.iter().eq_by(&b.segments, |a, b| a.ident == b.ident)
                 }
                 _ => false,
             }