You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

syn

Package Overview
Dependencies
Maintainers
1
Versions
350
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

syn - cargo Package Compare versions

Comparing version
2.0.108
to
2.0.109
+1
-1
.cargo_vcs_info.json
{
"git": {
"sha1": "7a7e331255822d49bea01e29c326ee7a5cd5415c"
"sha1": "085e597131aa7de382e20402114b45362a06fe34"
},
"path_in_vcs": ""
}

@@ -31,3 +31,3 @@ # This file is automatically @generated by Cargo.

"quote",
"syn 2.0.107",
"syn 2.0.108",
]

@@ -61,5 +61,5 @@

name = "cc"
version = "1.2.41"
version = "1.2.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac9fe6cdbb24b6ade63616c0a0688e45bb56732262c158df3c0c4bea4ca47cb7"
checksum = "37521ac7aabe3d13122dc382493e20c9416f299d2ccd5b3a5340a2570cdeb0f3"
dependencies = [

@@ -146,3 +146,3 @@ "find-msvc-tools",

"quote",
"syn 2.0.107",
"syn 2.0.108",
]

@@ -213,5 +213,5 @@

name = "flate2"
version = "1.1.4"
version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc5a4e564e38c699f2880d3fda590bedc2e69f3f84cd48b457bd892ce61d0aa9"
checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb"
dependencies = [

@@ -472,5 +472,5 @@ "crc32fast",

name = "icu_collections"
version = "2.0.0"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47"
checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43"
dependencies = [

@@ -486,5 +486,5 @@ "displaydoc",

name = "icu_locale_core"
version = "2.0.0"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a"
checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6"
dependencies = [

@@ -500,7 +500,6 @@ "displaydoc",

name = "icu_normalizer"
version = "2.0.0"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979"
checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599"
dependencies = [
"displaydoc",
"icu_collections",

@@ -516,13 +515,12 @@ "icu_normalizer_data",

name = "icu_normalizer_data"
version = "2.0.0"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3"
checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a"
[[package]]
name = "icu_properties"
version = "2.0.1"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b"
checksum = "e93fcd3157766c0c8da2f8cff6ce651a31f0810eaa1c51ec363ef790bbb5fb99"
dependencies = [
"displaydoc",
"icu_collections",

@@ -532,3 +530,2 @@ "icu_locale_core",

"icu_provider",
"potential_utf",
"zerotrie",

@@ -540,16 +537,14 @@ "zerovec",

name = "icu_properties_data"
version = "2.0.1"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632"
checksum = "02845b3647bb045f1100ecd6480ff52f34c35f82d9880e029d329c21d1054899"
[[package]]
name = "icu_provider"
version = "2.0.0"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af"
checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614"
dependencies = [
"displaydoc",
"icu_locale_core",
"stable_deref_trait",
"tinystr",
"writeable",

@@ -612,5 +607,5 @@ "yoke",

name = "iri-string"
version = "0.7.8"
version = "0.7.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2"
checksum = "4f867b9d1d896b67beb18518eda36fdb77a32ea590de864f1325b294a6d14397"
dependencies = [

@@ -629,5 +624,5 @@ "memchr",

name = "js-sys"
version = "0.3.81"
version = "0.3.82"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec48937a97411dcb524a265206ccd4c90bb711fca92b2792c407f268825b9305"
checksum = "b011eec8cc36da2aab2d5cff675ec18454fad408585853910a202391cf9f8e65"
dependencies = [

@@ -663,5 +658,5 @@ "once_cell",

name = "litemap"
version = "0.8.0"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956"
checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77"

@@ -753,3 +748,3 @@ [[package]]

"quote",
"syn 2.0.107",
"syn 2.0.108",
]

@@ -801,5 +796,5 @@

name = "potential_utf"
version = "0.1.3"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84df19adbe5b5a0782edcab45899906947ab039ccf4573713735ee7de1e6b08a"
checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77"
dependencies = [

@@ -811,5 +806,5 @@ "zerovec",

name = "proc-macro2"
version = "1.0.102"
version = "1.0.103"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e0f6df8eaa422d97d72edcd152e1451618fed47fabbdbd5a8864167b1d4aff7"
checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8"
dependencies = [

@@ -880,3 +875,3 @@ "unicode-ident",

"quote",
"syn 2.0.107",
"syn 2.0.108",
]

@@ -955,5 +950,5 @@

name = "rustls"
version = "0.23.34"
version = "0.23.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a9586e9ee2b4f8fab52a0048ca7334d7024eef48e2cb9407e3497bb7cab7fa7"
checksum = "533f54bc6a7d4f647e46ad909549eda97bf5afc1585190ef692b4286b198bd8f"
dependencies = [

@@ -969,5 +964,5 @@ "once_cell",

name = "rustls-pki-types"
version = "1.12.0"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79"
checksum = "94182ad936a0c91c324cd46c6511b9510ed16af436d7b5bab34beab0afd55f7a"
dependencies = [

@@ -979,5 +974,5 @@ "zeroize",

name = "rustls-webpki"
version = "0.103.7"
version = "0.103.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e10b3f4191e8a80e6b43eebabfac91e5dcecebb27a71f04e820c47ec41d314bf"
checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52"
dependencies = [

@@ -1069,3 +1064,3 @@ "ring",

"quote",
"syn 2.0.107",
"syn 2.0.108",
]

@@ -1152,5 +1147,5 @@

name = "syn"
version = "2.0.107"
version = "2.0.108"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a26dbd934e5451d21ef060c018dae56fc073894c5a7896f882928a76e6d081b"
checksum = "da58917d35242480a05c2897064da0a80589a2a0476c9a3f2fdc83b53502e917"
dependencies = [

@@ -1164,3 +1159,3 @@ "proc-macro2",

name = "syn"
version = "2.0.108"
version = "2.0.109"
dependencies = [

@@ -1207,3 +1202,3 @@ "anyhow",

"quote",
"syn 2.0.107",
"syn 2.0.108",
]

@@ -1267,5 +1262,5 @@

name = "tinystr"
version = "0.8.1"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b"
checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869"
dependencies = [

@@ -1312,5 +1307,5 @@ "displaydoc",

name = "tokio-util"
version = "0.7.16"
version = "0.7.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5"
checksum = "2efa149fe76073d6e8fd97ef4f4eca7b67f599660115591483572e406e165594"
dependencies = [

@@ -1396,5 +1391,5 @@ "bytes",

name = "unicode-ident"
version = "1.0.20"
version = "1.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "462eeb75aeb73aea900253ce739c8e18a67423fadf006037cd3ff27e82748a06"
checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"

@@ -1467,5 +1462,5 @@ [[package]]

name = "wasm-bindgen"
version = "0.2.104"
version = "0.2.105"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1da10c01ae9f1ae40cbfac0bac3b1e724b320abfcf52229f80b547c0d250e2d"
checksum = "da95793dfc411fbbd93f5be7715b0578ec61fe87cb1a42b12eb625caa5c5ea60"
dependencies = [

@@ -1480,20 +1475,6 @@ "cfg-if",

[[package]]
name = "wasm-bindgen-backend"
version = "0.2.104"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "671c9a5a66f49d8a47345ab942e2cb93c7d1d0339065d4f8139c486121b43b19"
dependencies = [
"bumpalo",
"log",
"proc-macro2",
"quote",
"syn 2.0.107",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-futures"
version = "0.4.54"
version = "0.4.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e038d41e478cc73bae0ff9b36c60cff1c98b8f38f8d7e8061e79ee63608ac5c"
checksum = "551f88106c6d5e7ccc7cd9a16f312dd3b5d36ea8b4954304657d5dfba115d4a0"
dependencies = [

@@ -1509,5 +1490,5 @@ "cfg-if",

name = "wasm-bindgen-macro"
version = "0.2.104"
version = "0.2.105"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ca60477e4c59f5f2986c50191cd972e3a50d8a95603bc9434501cf156a9a119"
checksum = "04264334509e04a7bf8690f2384ef5265f05143a4bff3889ab7a3269adab59c2"
dependencies = [

@@ -1520,10 +1501,10 @@ "quote",

name = "wasm-bindgen-macro-support"
version = "0.2.104"
version = "0.2.105"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7"
checksum = "420bc339d9f322e562942d52e115d57e950d12d88983a14c79b86859ee6c7ebc"
dependencies = [
"bumpalo",
"proc-macro2",
"quote",
"syn 2.0.107",
"wasm-bindgen-backend",
"syn 2.0.108",
"wasm-bindgen-shared",

@@ -1534,5 +1515,5 @@ ]

name = "wasm-bindgen-shared"
version = "0.2.104"
version = "0.2.105"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bad67dc8b2a1a6e5448428adec4c3e84c43e561d8c9ee8a9e5aabeb193ec41d1"
checksum = "76f218a38c84bcb33c25ec7059b07847d465ce0e0a76b995e134a45adcb6af76"
dependencies = [

@@ -1544,5 +1525,5 @@ "unicode-ident",

name = "web-sys"
version = "0.3.81"
version = "0.3.82"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9367c417a924a74cae129e6a2ae3b47fabb1f8995595ab474029da749a8be120"
checksum = "3a1f95c0d03a47f4ae1f7a64643a6bb97465d9b740f0fa8f90ea33915c99a9a1"
dependencies = [

@@ -1776,5 +1757,5 @@ "js-sys",

name = "writeable"
version = "0.6.1"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb"
checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9"

@@ -1793,7 +1774,6 @@ [[package]]

name = "yoke"
version = "0.8.0"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc"
checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954"
dependencies = [
"serde",
"stable_deref_trait",

@@ -1806,9 +1786,9 @@ "yoke-derive",

name = "yoke-derive"
version = "0.8.0"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6"
checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.107",
"syn 2.0.108",
"synstructure",

@@ -1834,3 +1814,3 @@ ]

"quote",
"syn 2.0.107",
"syn 2.0.108",
"synstructure",

@@ -1847,5 +1827,5 @@ ]

name = "zerotrie"
version = "0.2.2"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595"
checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851"
dependencies = [

@@ -1859,5 +1839,5 @@ "displaydoc",

name = "zerovec"
version = "0.11.4"
version = "0.11.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b"
checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002"
dependencies = [

@@ -1871,9 +1851,9 @@ "yoke",

name = "zerovec-derive"
version = "0.11.1"
version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f"
checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.107",
"syn 2.0.108",
]

@@ -16,3 +16,3 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO

name = "syn"
version = "2.0.108"
version = "2.0.109"
authors = ["David Tolnay <dtolnay@gmail.com>"]

@@ -19,0 +19,0 @@ build = false

@@ -12,2 +12,3 @@ //! A stably addressed token buffer supporting efficient traversal based on a

use std::cmp::Ordering;
use std::iter;
use std::marker::PhantomData;

@@ -289,9 +290,9 @@ use std::ptr;

pub fn token_stream(self) -> TokenStream {
let mut tts = Vec::new();
let mut tokens = TokenStream::new();
let mut cursor = self;
while let Some((tt, rest)) = cursor.token_tree() {
tts.push(tt);
tokens.extend(iter::once(tt));
cursor = rest;
}
tts.into_iter().collect()
tokens
}

@@ -298,0 +299,0 @@

@@ -34,2 +34,3 @@ /// Define a type that supports parsing and printing a multi-character symbol

/// use proc_macro2::{TokenStream, TokenTree};
/// use std::iter;
/// use syn::parse::{Parse, ParseStream, Peek, Result};

@@ -68,3 +69,3 @@ /// use syn::punctuated::Punctuated;

/// let next: TokenTree = input.parse()?;
/// tokens.extend(Some(next));
/// tokens.extend(iter::once(next));
/// }

@@ -71,0 +72,0 @@ /// Ok(tokens)

@@ -226,6 +226,7 @@ #[cfg(feature = "parsing")]

pub fn to_compile_error(&self) -> TokenStream {
self.messages
.iter()
.map(ErrorMessage::to_compile_error)
.collect()
let mut tokens = TokenStream::new();
for msg in &self.messages {
tokens.extend(ErrorMessage::to_compile_error(msg));
}
tokens
}

@@ -232,0 +233,0 @@

@@ -252,4 +252,4 @@ //! [![github]](https://github.com/dtolnay/syn)&ensp;[![crates-io]](https://crates.io/crates/syn)&ensp;[![docs-rs]](crate)

// Syn types in rustdoc of other crates get linked to here.
#![doc(html_root_url = "https://docs.rs/syn/2.0.108")]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc(html_root_url = "https://docs.rs/syn/2.0.109")]
#![cfg_attr(docsrs, feature(doc_cfg), doc(auto_cfg = false))]
#![deny(unsafe_op_in_unsafe_fn)]

@@ -256,0 +256,0 @@ #![allow(non_camel_case_types)]

@@ -13,2 +13,4 @@ #[cfg(feature = "parsing")]

use std::hash::{Hash, Hasher};
#[cfg(feature = "parsing")]
use std::iter;
use std::str::{self, FromStr};

@@ -219,6 +221,7 @@

fn respan_token_stream(stream: TokenStream, span: Span) -> TokenStream {
stream
.into_iter()
.map(|token| respan_token_tree(token, span))
.collect()
let mut tokens = TokenStream::new();
for token in stream {
tokens.extend(iter::once(respan_token_tree(token, span)));
}
tokens
}

@@ -225,0 +228,0 @@

@@ -8,2 +8,3 @@ use crate::buffer::Cursor;

use std::cell::RefCell;
use std::fmt::{self, Display};

@@ -143,4 +144,3 @@ /// Support for checking the next token in a stream to decide how to parse.

_ => {
let join = comparisons.join(", ");
let message = format!("expected one of: {}", join);
let message = format!("expected one of: {}", CommaSeparated(&comparisons));
error::new_at(self.scope, self.cursor, message)

@@ -152,2 +152,18 @@ }

struct CommaSeparated<'a>(&'a [&'a str]);
impl<'a> Display for CommaSeparated<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let mut first = true;
for &s in self.0 {
if !first {
f.write_str(", ")?;
}
f.write_str(s)?;
first = false;
}
Ok(())
}
}
/// Types that can be parsed by looking at just one token.

@@ -154,0 +170,0 @@ ///

@@ -30,2 +30,4 @@ //! A punctuated sequence of syntax tree nodes separated by punctuation.

use crate::token::Token;
#[cfg(all(feature = "fold", any(feature = "full", feature = "derive")))]
use std::collections::VecDeque;
#[cfg(feature = "extra-traits")]

@@ -523,5 +525,10 @@ use std::fmt::{self, Debug};

let mut elements = Vec::with_capacity(self.len());
elements.extend(self.inner.into_iter().map(|pair| pair.0));
elements.extend(self.last.map(|t| *t));
for (t, _) in self.inner {
elements.push(t);
}
if let Some(t) = self.last {
elements.push(*t);
}
IntoIter {

@@ -1111,9 +1118,16 @@ inner: elements.into_iter(),

{
let Punctuated { inner, last } = punctuated;
// Convert into VecDeque to prevent needing to allocate a new Vec<(T, P)>
// for the folded elements.
let mut inner = VecDeque::from(inner);
for _ in 0..inner.len() {
if let Some((t, p)) = inner.pop_front() {
inner.push_back((f(fold, t), p));
}
}
Punctuated {
inner: punctuated
.inner
.into_iter()
.map(|(t, p)| (f(fold, t), p))
.collect(),
last: match punctuated.last {
inner: Vec::from(inner),
last: match last {
Some(t) => Some(Box::new(f(fold, *t))),

@@ -1120,0 +1134,0 @@ None => None,

@@ -146,3 +146,3 @@ //! Tokens representing Rust punctuation, keywords, and delimiters.

#[repr(transparent)]
#[allow(unknown_lints, repr_transparent_external_private_fields)] // False positive: https://github.com/rust-lang/rust/issues/78586#issuecomment-1722680482
#[allow(unknown_lints, repr_transparent_non_zst_fields)] // False positive: https://github.com/rust-lang/rust/issues/115922
pub struct WithSpan {

@@ -328,3 +328,3 @@ pub span: Span,

#[cfg_attr(not(doc), repr(transparent))]
#[allow(unknown_lints, repr_transparent_external_private_fields)] // False positive: https://github.com/rust-lang/rust/issues/78586#issuecomment-1722680482
#[allow(unknown_lints, repr_transparent_non_zst_fields)] // False positive: https://github.com/rust-lang/rust/issues/115922
#[doc = concat!('`', $token, '`')]

@@ -331,0 +331,0 @@ ///

+18
-29

@@ -1,2 +0,2 @@

use proc_macro2::{Delimiter, TokenStream, TokenTree};
use proc_macro2::{Delimiter, Spacing, TokenStream, TokenTree};
use std::hash::{Hash, Hasher};

@@ -8,4 +8,2 @@

fn eq(&self, other: &Self) -> bool {
use proc_macro2::Spacing;
match (self.0, other.0) {

@@ -21,15 +19,3 @@ (TokenTree::Group(g1), TokenTree::Group(g2)) => {

let s1 = g1.stream().into_iter();
let mut s2 = g2.stream().into_iter();
for item1 in s1 {
let item2 = match s2.next() {
Some(item) => item,
None => return false,
};
if TokenTreeHelper(&item1) != TokenTreeHelper(&item2) {
return false;
}
}
s2.next().is_none()
TokenStreamHelper(&g1.stream()) == TokenStreamHelper(&g2.stream())
}

@@ -52,4 +38,2 @@ (TokenTree::Punct(o1), TokenTree::Punct(o2)) => {

fn hash<H: Hasher>(&self, h: &mut H) {
use proc_macro2::Spacing;
match self.0 {

@@ -88,13 +72,16 @@ TokenTree::Group(g) => {

fn eq(&self, other: &Self) -> bool {
let left = self.0.clone().into_iter().collect::<Vec<_>>();
let right = other.0.clone().into_iter().collect::<Vec<_>>();
if left.len() != right.len() {
return false;
}
for (a, b) in left.into_iter().zip(right) {
if TokenTreeHelper(&a) != TokenTreeHelper(&b) {
let left = self.0.clone().into_iter();
let mut right = other.0.clone().into_iter();
for item1 in left {
let item2 = match right.next() {
Some(item) => item,
None => return false,
};
if TokenTreeHelper(&item1) != TokenTreeHelper(&item2) {
return false;
}
}
true
right.next().is_none()
}

@@ -105,5 +92,7 @@ }

fn hash<H: Hasher>(&self, state: &mut H) {
let tts = self.0.clone().into_iter().collect::<Vec<_>>();
tts.len().hash(state);
for tt in tts {
let tokens = self.0.clone().into_iter();
tokens.clone().count().hash(state);
for tt in tokens {
TokenTreeHelper(&tt).hash(state);

@@ -110,0 +99,0 @@ }

@@ -128,2 +128,3 @@ #![allow(unused_macro_rules)]

use rustc_ast::ast::PathSegment;
use rustc_ast::ast::Pinnedness;
use rustc_ast::ast::PolyTraitRef;

@@ -146,2 +147,3 @@ use rustc_ast::ast::PreciseCapturingArg;

use rustc_ast::ast::Trait;
use rustc_ast::ast::TraitAlias;
use rustc_ast::ast::TraitBoundModifiers;

@@ -153,4 +155,2 @@ use rustc_ast::ast::TraitImplHeader;

use rustc_ast::ast::TyAlias;
use rustc_ast::ast::TyAliasWhereClause;
use rustc_ast::ast::TyAliasWhereClauses;
use rustc_ast::ast::TyKind;

@@ -502,3 +502,3 @@ use rustc_ast::ast::TyPat;

spanless_eq_struct!(Fn; defaultness ident generics sig contract define_opaque body);
spanless_eq_struct!(FnContract; requires ensures);
spanless_eq_struct!(FnContract; declarations requires ensures);
spanless_eq_struct!(FnDecl; inputs output);

@@ -546,2 +546,3 @@ spanless_eq_struct!(FnHeader; constness coroutine_kind safety ext);

spanless_eq_struct!(Trait; constness safety is_auto ident generics bounds items);
spanless_eq_struct!(TraitAlias; constness ident generics bounds);
spanless_eq_struct!(TraitBoundModifiers; constness asyncness polarity);

@@ -551,5 +552,3 @@ spanless_eq_struct!(TraitImplHeader; defaultness safety constness polarity trait_ref);

spanless_eq_struct!(Ty; id kind span tokens);
spanless_eq_struct!(TyAlias; defaultness ident generics where_clauses bounds ty);
spanless_eq_struct!(TyAliasWhereClause; !has_where_token span);
spanless_eq_struct!(TyAliasWhereClauses; before after !split);
spanless_eq_struct!(TyAlias; defaultness ident generics after_where_clause bounds ty);
spanless_eq_struct!(TyPat; id kind span tokens);

@@ -578,3 +577,3 @@ spanless_eq_struct!(UnsafeBinderTy; generic_params inner_ty);

spanless_eq_enum!(BoundPolarity; Positive Negative(0) Maybe(0));
spanless_eq_enum!(ByRef; Yes(0) No);
spanless_eq_enum!(ByRef; Yes(0 1) No);
spanless_eq_enum!(CaptureBy; Value(move_kw) Ref Use(use_kw));

@@ -620,2 +619,3 @@ spanless_eq_enum!(ClosureBinder; NotPresent For(span generic_params));

spanless_eq_enum!(PatFieldsRest; Rest(0) Recovered(0) None);
spanless_eq_enum!(Pinnedness; Not Pinned);
spanless_eq_enum!(PreciseCapturingArg; Lifetime(0) Arg(0 1));

@@ -632,3 +632,3 @@ spanless_eq_enum!(RangeEnd; Included(0) Excluded);

spanless_eq_enum!(TraitObjectSyntax; Dyn None);
spanless_eq_enum!(TyPatKind; Range(0 1 2) Or(0) Err(0));
spanless_eq_enum!(TyPatKind; Range(0 1 2) NotNull Or(0) Err(0));
spanless_eq_enum!(UintTy; Usize U8 U16 U32 U64 U128);

@@ -662,3 +662,3 @@ spanless_eq_enum!(UnOp; Deref Not Neg);

Mod(0 1 2) ForeignMod(0) GlobalAsm(0) TyAlias(0) Enum(0 1 2) Struct(0 1 2)
Union(0 1 2) Trait(0) TraitAlias(0 1 2) Impl(0) MacCall(0) MacroDef(0 1)
Union(0 1 2) Trait(0) TraitAlias(0) Impl(0) MacCall(0) MacroDef(0 1)
Delegation(0) DelegationMac(0));

@@ -665,0 +665,0 @@ spanless_eq_enum!(LitKind; Str(0 1) ByteStr(0 1) CStr(0 1) Byte(0) Char(0)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display