Skip to content

Commit 9b8bf53

Browse files
authored
Rollup merge of rust-lang#141570 - chenyukang:yukang-fix-eq_unspanned, r=workingjubilee
Fix incorrect eq_unspanned in TokenStream Fixes rust-lang#141522 r? ``@workingjubilee`` should we remove this function? since it's used in several places, i'd prefer to keep it.
2 parents a0b0f91 + f6e5fa2 commit 9b8bf53

File tree

1 file changed

+3
-1
lines changed
  • clippy_utils/src/ast_utils

1 file changed

+3
-1
lines changed

clippy_utils/src/ast_utils/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,5 +960,7 @@ pub fn eq_attr_args(l: &AttrArgs, r: &AttrArgs) -> bool {
960960
}
961961

962962
pub fn eq_delim_args(l: &DelimArgs, r: &DelimArgs) -> bool {
963-
l.delim == r.delim && l.tokens.eq_unspanned(&r.tokens)
963+
l.delim == r.delim
964+
&& l.tokens.len() == r.tokens.len()
965+
&& l.tokens.iter().zip(r.tokens.iter()).all(|(a, b)| a.eq_unspanned(b))
964966
}

0 commit comments

Comments
 (0)