From 1376c5a617be5c25655d0d7cb63e3beaa5a6e026 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:20:39 +0200 Subject: Merging upstream version 1.70.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/syn/src/gen/eq.rs | 446 +++++++++++++++++++++-------------------------- 1 file changed, 201 insertions(+), 245 deletions(-) (limited to 'vendor/syn/src/gen/eq.rs') diff --git a/vendor/syn/src/gen/eq.rs b/vendor/syn/src/gen/eq.rs index 20acb809d..a7479c300 100644 --- a/vendor/syn/src/gen/eq.rs +++ b/vendor/syn/src/gen/eq.rs @@ -37,6 +37,28 @@ impl PartialEq for Arm { } #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] +impl Eq for AssocConst {} +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] +impl PartialEq for AssocConst { + fn eq(&self, other: &Self) -> bool { + self.ident == other.ident && self.generics == other.generics + && self.value == other.value + } +} +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] +impl Eq for AssocType {} +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] +impl PartialEq for AssocType { + fn eq(&self, other: &Self) -> bool { + self.ident == other.ident && self.generics == other.generics + && self.ty == other.ty + } +} +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for AttrStyle {} #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] @@ -56,8 +78,7 @@ impl Eq for Attribute {} #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl PartialEq for Attribute { fn eq(&self, other: &Self) -> bool { - self.style == other.style && self.path == other.path - && TokenStreamHelper(&self.tokens) == TokenStreamHelper(&other.tokens) + self.style == other.style && self.meta == other.meta } } #[cfg(any(feature = "derive", feature = "full"))] @@ -72,6 +93,16 @@ impl PartialEq for BareFnArg { } #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] +impl Eq for BareVariadic {} +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] +impl PartialEq for BareVariadic { + fn eq(&self, other: &Self) -> bool { + self.attrs == other.attrs && self.name == other.name && self.comma == other.comma + } +} +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for BinOp {} #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] @@ -96,30 +127,20 @@ impl PartialEq for BinOp { (BinOp::Ne(_), BinOp::Ne(_)) => true, (BinOp::Ge(_), BinOp::Ge(_)) => true, (BinOp::Gt(_), BinOp::Gt(_)) => true, - (BinOp::AddEq(_), BinOp::AddEq(_)) => true, - (BinOp::SubEq(_), BinOp::SubEq(_)) => true, - (BinOp::MulEq(_), BinOp::MulEq(_)) => true, - (BinOp::DivEq(_), BinOp::DivEq(_)) => true, - (BinOp::RemEq(_), BinOp::RemEq(_)) => true, - (BinOp::BitXorEq(_), BinOp::BitXorEq(_)) => true, - (BinOp::BitAndEq(_), BinOp::BitAndEq(_)) => true, - (BinOp::BitOrEq(_), BinOp::BitOrEq(_)) => true, - (BinOp::ShlEq(_), BinOp::ShlEq(_)) => true, - (BinOp::ShrEq(_), BinOp::ShrEq(_)) => true, + (BinOp::AddAssign(_), BinOp::AddAssign(_)) => true, + (BinOp::SubAssign(_), BinOp::SubAssign(_)) => true, + (BinOp::MulAssign(_), BinOp::MulAssign(_)) => true, + (BinOp::DivAssign(_), BinOp::DivAssign(_)) => true, + (BinOp::RemAssign(_), BinOp::RemAssign(_)) => true, + (BinOp::BitXorAssign(_), BinOp::BitXorAssign(_)) => true, + (BinOp::BitAndAssign(_), BinOp::BitAndAssign(_)) => true, + (BinOp::BitOrAssign(_), BinOp::BitOrAssign(_)) => true, + (BinOp::ShlAssign(_), BinOp::ShlAssign(_)) => true, + (BinOp::ShrAssign(_), BinOp::ShrAssign(_)) => true, _ => false, } } } -#[cfg(any(feature = "derive", feature = "full"))] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for Binding {} -#[cfg(any(feature = "derive", feature = "full"))] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for Binding { - fn eq(&self, other: &Self) -> bool { - self.ident == other.ident && self.ty == other.ty - } -} #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for Block {} @@ -158,7 +179,8 @@ impl Eq for Constraint {} #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl PartialEq for Constraint { fn eq(&self, other: &Self) -> bool { - self.ident == other.ident && self.bounds == other.bounds + self.ident == other.ident && self.generics == other.generics + && self.bounds == other.bounds } } #[cfg(feature = "derive")] @@ -230,8 +252,6 @@ impl PartialEq for Expr { #[cfg(feature = "full")] (Expr::Assign(self0), Expr::Assign(other0)) => self0 == other0, #[cfg(feature = "full")] - (Expr::AssignOp(self0), Expr::AssignOp(other0)) => self0 == other0, - #[cfg(feature = "full")] (Expr::Async(self0), Expr::Async(other0)) => self0 == other0, #[cfg(feature = "full")] (Expr::Await(self0), Expr::Await(other0)) => self0 == other0, @@ -239,29 +259,29 @@ impl PartialEq for Expr { #[cfg(feature = "full")] (Expr::Block(self0), Expr::Block(other0)) => self0 == other0, #[cfg(feature = "full")] - (Expr::Box(self0), Expr::Box(other0)) => self0 == other0, - #[cfg(feature = "full")] (Expr::Break(self0), Expr::Break(other0)) => self0 == other0, (Expr::Call(self0), Expr::Call(other0)) => self0 == other0, (Expr::Cast(self0), Expr::Cast(other0)) => self0 == other0, #[cfg(feature = "full")] (Expr::Closure(self0), Expr::Closure(other0)) => self0 == other0, #[cfg(feature = "full")] + (Expr::Const(self0), Expr::Const(other0)) => self0 == other0, + #[cfg(feature = "full")] (Expr::Continue(self0), Expr::Continue(other0)) => self0 == other0, (Expr::Field(self0), Expr::Field(other0)) => self0 == other0, #[cfg(feature = "full")] (Expr::ForLoop(self0), Expr::ForLoop(other0)) => self0 == other0, - #[cfg(feature = "full")] (Expr::Group(self0), Expr::Group(other0)) => self0 == other0, #[cfg(feature = "full")] (Expr::If(self0), Expr::If(other0)) => self0 == other0, (Expr::Index(self0), Expr::Index(other0)) => self0 == other0, #[cfg(feature = "full")] + (Expr::Infer(self0), Expr::Infer(other0)) => self0 == other0, + #[cfg(feature = "full")] (Expr::Let(self0), Expr::Let(other0)) => self0 == other0, (Expr::Lit(self0), Expr::Lit(other0)) => self0 == other0, #[cfg(feature = "full")] (Expr::Loop(self0), Expr::Loop(other0)) => self0 == other0, - #[cfg(feature = "full")] (Expr::Macro(self0), Expr::Macro(other0)) => self0 == other0, #[cfg(feature = "full")] (Expr::Match(self0), Expr::Match(other0)) => self0 == other0, @@ -285,8 +305,6 @@ impl PartialEq for Expr { (Expr::TryBlock(self0), Expr::TryBlock(other0)) => self0 == other0, #[cfg(feature = "full")] (Expr::Tuple(self0), Expr::Tuple(other0)) => self0 == other0, - #[cfg(feature = "full")] - (Expr::Type(self0), Expr::Type(other0)) => self0 == other0, (Expr::Unary(self0), Expr::Unary(other0)) => self0 == other0, #[cfg(feature = "full")] (Expr::Unsafe(self0), Expr::Unsafe(other0)) => self0 == other0, @@ -323,17 +341,6 @@ impl PartialEq for ExprAssign { } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for ExprAssignOp {} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for ExprAssignOp { - fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.left == other.left && self.op == other.op - && self.right == other.right - } -} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for ExprAsync {} #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] @@ -377,16 +384,6 @@ impl PartialEq for ExprBlock { } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for ExprBox {} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for ExprBox { - fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.expr == other.expr - } -} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for ExprBreak {} #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] @@ -422,7 +419,8 @@ impl Eq for ExprClosure {} #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl PartialEq for ExprClosure { fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.movability == other.movability + self.attrs == other.attrs && self.lifetimes == other.lifetimes + && self.constness == other.constness && self.movability == other.movability && self.asyncness == other.asyncness && self.capture == other.capture && self.inputs == other.inputs && self.output == other.output && self.body == other.body @@ -430,6 +428,16 @@ impl PartialEq for ExprClosure { } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] +impl Eq for ExprConst {} +#[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] +impl PartialEq for ExprConst { + fn eq(&self, other: &Self) -> bool { + self.attrs == other.attrs && self.block == other.block + } +} +#[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for ExprContinue {} #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] @@ -460,10 +468,10 @@ impl PartialEq for ExprForLoop { && self.expr == other.expr && self.body == other.body } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for ExprGroup {} -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl PartialEq for ExprGroup { fn eq(&self, other: &Self) -> bool { @@ -494,6 +502,16 @@ impl PartialEq for ExprIndex { } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] +impl Eq for ExprInfer {} +#[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] +impl PartialEq for ExprInfer { + fn eq(&self, other: &Self) -> bool { + self.attrs == other.attrs + } +} +#[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for ExprLet {} #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] @@ -522,10 +540,10 @@ impl PartialEq for ExprLoop { self.attrs == other.attrs && self.label == other.label && self.body == other.body } } -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for ExprMacro {} -#[cfg(feature = "full")] +#[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl PartialEq for ExprMacro { fn eq(&self, other: &Self) -> bool { @@ -581,8 +599,8 @@ impl Eq for ExprRange {} #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl PartialEq for ExprRange { fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.from == other.from - && self.limits == other.limits && self.to == other.to + self.attrs == other.attrs && self.start == other.start + && self.limits == other.limits && self.end == other.end } } #[cfg(feature = "full")] @@ -623,7 +641,7 @@ impl Eq for ExprStruct {} #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl PartialEq for ExprStruct { fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.path == other.path + self.attrs == other.attrs && self.qself == other.qself && self.path == other.path && self.fields == other.fields && self.dot2_token == other.dot2_token && self.rest == other.rest } @@ -658,16 +676,6 @@ impl PartialEq for ExprTuple { self.attrs == other.attrs && self.elems == other.elems } } -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for ExprType {} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for ExprType { - fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.expr == other.expr && self.ty == other.ty - } -} #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for ExprUnary {} @@ -716,10 +724,23 @@ impl Eq for Field {} #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl PartialEq for Field { fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.vis == other.vis && self.ident == other.ident + self.attrs == other.attrs && self.vis == other.vis + && self.mutability == other.mutability && self.ident == other.ident && self.colon_token == other.colon_token && self.ty == other.ty } } +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] +impl Eq for FieldMutability {} +#[cfg(any(feature = "derive", feature = "full"))] +#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] +impl PartialEq for FieldMutability { + fn eq(&self, other: &Self) -> bool { + match (self, other) { + (FieldMutability::None, FieldMutability::None) => true, + } + } +} #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for FieldPat {} @@ -862,6 +883,7 @@ impl Eq for ForeignItemType {} impl PartialEq for ForeignItemType { fn eq(&self, other: &Self) -> bool { self.attrs == other.attrs && self.vis == other.vis && self.ident == other.ident + && self.generics == other.generics } } #[cfg(any(feature = "derive", feature = "full"))] @@ -881,31 +903,15 @@ impl PartialEq for GenericArgument { (GenericArgument::Const(self0), GenericArgument::Const(other0)) => { self0 == other0 } - (GenericArgument::Binding(self0), GenericArgument::Binding(other0)) => { + (GenericArgument::AssocType(self0), GenericArgument::AssocType(other0)) => { self0 == other0 } - (GenericArgument::Constraint(self0), GenericArgument::Constraint(other0)) => { + (GenericArgument::AssocConst(self0), GenericArgument::AssocConst(other0)) => { self0 == other0 } - _ => false, - } - } -} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for GenericMethodArgument {} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for GenericMethodArgument { - fn eq(&self, other: &Self) -> bool { - match (self, other) { - (GenericMethodArgument::Type(self0), GenericMethodArgument::Type(other0)) => { + (GenericArgument::Constraint(self0), GenericArgument::Constraint(other0)) => { self0 == other0 } - ( - GenericMethodArgument::Const(self0), - GenericMethodArgument::Const(other0), - ) => self0 == other0, _ => false, } } @@ -918,10 +924,10 @@ impl Eq for GenericParam {} impl PartialEq for GenericParam { fn eq(&self, other: &Self) -> bool { match (self, other) { - (GenericParam::Type(self0), GenericParam::Type(other0)) => self0 == other0, (GenericParam::Lifetime(self0), GenericParam::Lifetime(other0)) => { self0 == other0 } + (GenericParam::Type(self0), GenericParam::Type(other0)) => self0 == other0, (GenericParam::Const(self0), GenericParam::Const(other0)) => self0 == other0, _ => false, } @@ -947,7 +953,7 @@ impl PartialEq for ImplItem { fn eq(&self, other: &Self) -> bool { match (self, other) { (ImplItem::Const(self0), ImplItem::Const(other0)) => self0 == other0, - (ImplItem::Method(self0), ImplItem::Method(other0)) => self0 == other0, + (ImplItem::Fn(self0), ImplItem::Fn(other0)) => self0 == other0, (ImplItem::Type(self0), ImplItem::Type(other0)) => self0 == other0, (ImplItem::Macro(self0), ImplItem::Macro(other0)) => self0 == other0, (ImplItem::Verbatim(self0), ImplItem::Verbatim(other0)) => { @@ -966,30 +972,31 @@ impl PartialEq for ImplItemConst { fn eq(&self, other: &Self) -> bool { self.attrs == other.attrs && self.vis == other.vis && self.defaultness == other.defaultness && self.ident == other.ident - && self.ty == other.ty && self.expr == other.expr + && self.generics == other.generics && self.ty == other.ty + && self.expr == other.expr } } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for ImplItemMacro {} +impl Eq for ImplItemFn {} #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for ImplItemMacro { +impl PartialEq for ImplItemFn { fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.mac == other.mac - && self.semi_token == other.semi_token + self.attrs == other.attrs && self.vis == other.vis + && self.defaultness == other.defaultness && self.sig == other.sig + && self.block == other.block } } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for ImplItemMethod {} +impl Eq for ImplItemMacro {} #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for ImplItemMethod { +impl PartialEq for ImplItemMacro { fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.vis == other.vis - && self.defaultness == other.defaultness && self.sig == other.sig - && self.block == other.block + self.attrs == other.attrs && self.mac == other.mac + && self.semi_token == other.semi_token } } #[cfg(feature = "full")] @@ -1006,6 +1013,16 @@ impl PartialEq for ImplItemType { } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] +impl Eq for ImplRestriction {} +#[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] +impl PartialEq for ImplRestriction { + fn eq(&self, _other: &Self) -> bool { + match *self {} + } +} +#[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for Item {} #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] @@ -1019,7 +1036,6 @@ impl PartialEq for Item { (Item::ForeignMod(self0), Item::ForeignMod(other0)) => self0 == other0, (Item::Impl(self0), Item::Impl(other0)) => self0 == other0, (Item::Macro(self0), Item::Macro(other0)) => self0 == other0, - (Item::Macro2(self0), Item::Macro2(other0)) => self0 == other0, (Item::Mod(self0), Item::Mod(other0)) => self0 == other0, (Item::Static(self0), Item::Static(other0)) => self0 == other0, (Item::Struct(self0), Item::Struct(other0)) => self0 == other0, @@ -1043,7 +1059,8 @@ impl Eq for ItemConst {} impl PartialEq for ItemConst { fn eq(&self, other: &Self) -> bool { self.attrs == other.attrs && self.vis == other.vis && self.ident == other.ident - && self.ty == other.ty && self.expr == other.expr + && self.generics == other.generics && self.ty == other.ty + && self.expr == other.expr } } #[cfg(feature = "full")] @@ -1086,7 +1103,8 @@ impl Eq for ItemForeignMod {} #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl PartialEq for ItemForeignMod { fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.abi == other.abi && self.items == other.items + self.attrs == other.attrs && self.unsafety == other.unsafety + && self.abi == other.abi && self.items == other.items } } #[cfg(feature = "full")] @@ -1115,23 +1133,13 @@ impl PartialEq for ItemMacro { } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for ItemMacro2 {} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for ItemMacro2 { - fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.vis == other.vis && self.ident == other.ident - && TokenStreamHelper(&self.rules) == TokenStreamHelper(&other.rules) - } -} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for ItemMod {} #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl PartialEq for ItemMod { fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.vis == other.vis && self.ident == other.ident + self.attrs == other.attrs && self.vis == other.vis + && self.unsafety == other.unsafety && self.ident == other.ident && self.content == other.content && self.semi == other.semi } } @@ -1168,8 +1176,8 @@ impl PartialEq for ItemTrait { fn eq(&self, other: &Self) -> bool { self.attrs == other.attrs && self.vis == other.vis && self.unsafety == other.unsafety && self.auto_token == other.auto_token - && self.ident == other.ident && self.generics == other.generics - && self.colon_token == other.colon_token + && self.restriction == other.restriction && self.ident == other.ident + && self.generics == other.generics && self.colon_token == other.colon_token && self.supertraits == other.supertraits && self.items == other.items } } @@ -1229,10 +1237,10 @@ impl PartialEq for Label { } #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for LifetimeDef {} +impl Eq for LifetimeParam {} #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for LifetimeDef { +impl PartialEq for LifetimeParam { fn eq(&self, other: &Self) -> bool { self.attrs == other.attrs && self.lifetime == other.lifetime && self.colon_token == other.colon_token && self.bounds == other.bounds @@ -1288,6 +1296,16 @@ impl PartialEq for Local { self.attrs == other.attrs && self.pat == other.pat && self.init == other.init } } +#[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] +impl Eq for LocalInit {} +#[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] +impl PartialEq for LocalInit { + fn eq(&self, other: &Self) -> bool { + self.expr == other.expr && self.diverge == other.diverge + } +} #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for Macro {} @@ -1336,7 +1354,8 @@ impl Eq for MetaList {} #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl PartialEq for MetaList { fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.nested == other.nested + self.path == other.path && self.delimiter == other.delimiter + && TokenStreamHelper(&self.tokens) == TokenStreamHelper(&other.tokens) } } #[cfg(any(feature = "derive", feature = "full"))] @@ -1346,31 +1365,7 @@ impl Eq for MetaNameValue {} #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl PartialEq for MetaNameValue { fn eq(&self, other: &Self) -> bool { - self.path == other.path && self.lit == other.lit - } -} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for MethodTurbofish {} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for MethodTurbofish { - fn eq(&self, other: &Self) -> bool { - self.args == other.args - } -} -#[cfg(any(feature = "derive", feature = "full"))] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for NestedMeta {} -#[cfg(any(feature = "derive", feature = "full"))] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for NestedMeta { - fn eq(&self, other: &Self) -> bool { - match (self, other) { - (NestedMeta::Meta(self0), NestedMeta::Meta(other0)) => self0 == other0, - (NestedMeta::Lit(self0), NestedMeta::Lit(other0)) => self0 == other0, - _ => false, - } + self.path == other.path && self.value == other.value } } #[cfg(any(feature = "derive", feature = "full"))] @@ -1391,11 +1386,12 @@ impl Eq for Pat {} impl PartialEq for Pat { fn eq(&self, other: &Self) -> bool { match (self, other) { - (Pat::Box(self0), Pat::Box(other0)) => self0 == other0, + (Pat::Const(self0), Pat::Const(other0)) => self0 == other0, (Pat::Ident(self0), Pat::Ident(other0)) => self0 == other0, (Pat::Lit(self0), Pat::Lit(other0)) => self0 == other0, (Pat::Macro(self0), Pat::Macro(other0)) => self0 == other0, (Pat::Or(self0), Pat::Or(other0)) => self0 == other0, + (Pat::Paren(self0), Pat::Paren(other0)) => self0 == other0, (Pat::Path(self0), Pat::Path(other0)) => self0 == other0, (Pat::Range(self0), Pat::Range(other0)) => self0 == other0, (Pat::Reference(self0), Pat::Reference(other0)) => self0 == other0, @@ -1415,16 +1411,6 @@ impl PartialEq for Pat { } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for PatBox {} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for PatBox { - fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.pat == other.pat - } -} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for PatIdent {} #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] @@ -1437,26 +1423,6 @@ impl PartialEq for PatIdent { } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for PatLit {} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for PatLit { - fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.expr == other.expr - } -} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for PatMacro {} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for PatMacro { - fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.mac == other.mac - } -} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for PatOr {} #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] @@ -1468,23 +1434,12 @@ impl PartialEq for PatOr { } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for PatPath {} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for PatPath { - fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.qself == other.qself && self.path == other.path - } -} -#[cfg(feature = "full")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for PatRange {} +impl Eq for PatParen {} #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for PatRange { +impl PartialEq for PatParen { fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.lo == other.lo && self.limits == other.limits - && self.hi == other.hi + self.attrs == other.attrs && self.pat == other.pat } } #[cfg(feature = "full")] @@ -1525,8 +1480,8 @@ impl Eq for PatStruct {} #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl PartialEq for PatStruct { fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.path == other.path - && self.fields == other.fields && self.dot2_token == other.dot2_token + self.attrs == other.attrs && self.qself == other.qself && self.path == other.path + && self.fields == other.fields && self.rest == other.rest } } #[cfg(feature = "full")] @@ -1546,7 +1501,8 @@ impl Eq for PatTupleStruct {} #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl PartialEq for PatTupleStruct { fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.path == other.path && self.pat == other.pat + self.attrs == other.attrs && self.qself == other.qself && self.path == other.path + && self.elems == other.elems } } #[cfg(feature = "full")] @@ -1612,16 +1568,6 @@ impl PartialEq for PathSegment { } #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for PredicateEq {} -#[cfg(any(feature = "derive", feature = "full"))] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for PredicateEq { - fn eq(&self, other: &Self) -> bool { - self.lhs_ty == other.lhs_ty && self.rhs_ty == other.rhs_ty - } -} -#[cfg(any(feature = "derive", feature = "full"))] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for PredicateLifetime {} #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] @@ -1675,6 +1621,7 @@ impl PartialEq for Receiver { fn eq(&self, other: &Self) -> bool { self.attrs == other.attrs && self.reference == other.reference && self.mutability == other.mutability + && self.colon_token == other.colon_token && self.ty == other.ty } } #[cfg(any(feature = "derive", feature = "full"))] @@ -1707,6 +1654,20 @@ impl PartialEq for Signature { } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] +impl Eq for StaticMutability {} +#[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] +impl PartialEq for StaticMutability { + fn eq(&self, other: &Self) -> bool { + match (self, other) { + (StaticMutability::Mut(_), StaticMutability::Mut(_)) => true, + (StaticMutability::None, StaticMutability::None) => true, + _ => false, + } + } +} +#[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for Stmt {} #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] @@ -1715,12 +1676,25 @@ impl PartialEq for Stmt { match (self, other) { (Stmt::Local(self0), Stmt::Local(other0)) => self0 == other0, (Stmt::Item(self0), Stmt::Item(other0)) => self0 == other0, - (Stmt::Expr(self0), Stmt::Expr(other0)) => self0 == other0, - (Stmt::Semi(self0, _), Stmt::Semi(other0, _)) => self0 == other0, + (Stmt::Expr(self0, self1), Stmt::Expr(other0, other1)) => { + self0 == other0 && self1 == other1 + } + (Stmt::Macro(self0), Stmt::Macro(other0)) => self0 == other0, _ => false, } } } +#[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] +impl Eq for StmtMacro {} +#[cfg(feature = "full")] +#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] +impl PartialEq for StmtMacro { + fn eq(&self, other: &Self) -> bool { + self.attrs == other.attrs && self.mac == other.mac + && self.semi_token == other.semi_token + } +} #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for TraitBound {} @@ -1755,7 +1729,7 @@ impl PartialEq for TraitItem { fn eq(&self, other: &Self) -> bool { match (self, other) { (TraitItem::Const(self0), TraitItem::Const(other0)) => self0 == other0, - (TraitItem::Method(self0), TraitItem::Method(other0)) => self0 == other0, + (TraitItem::Fn(self0), TraitItem::Fn(other0)) => self0 == other0, (TraitItem::Type(self0), TraitItem::Type(other0)) => self0 == other0, (TraitItem::Macro(self0), TraitItem::Macro(other0)) => self0 == other0, (TraitItem::Verbatim(self0), TraitItem::Verbatim(other0)) => { @@ -1772,30 +1746,31 @@ impl Eq for TraitItemConst {} #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl PartialEq for TraitItemConst { fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.ident == other.ident && self.ty == other.ty + self.attrs == other.attrs && self.ident == other.ident + && self.generics == other.generics && self.ty == other.ty && self.default == other.default } } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for TraitItemMacro {} +impl Eq for TraitItemFn {} #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for TraitItemMacro { +impl PartialEq for TraitItemFn { fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.mac == other.mac - && self.semi_token == other.semi_token + self.attrs == other.attrs && self.sig == other.sig + && self.default == other.default && self.semi_token == other.semi_token } } #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for TraitItemMethod {} +impl Eq for TraitItemMacro {} #[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for TraitItemMethod { +impl PartialEq for TraitItemMacro { fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs && self.sig == other.sig - && self.default == other.default && self.semi_token == other.semi_token + self.attrs == other.attrs && self.mac == other.mac + && self.semi_token == other.semi_token } } #[cfg(feature = "full")] @@ -1937,6 +1912,9 @@ impl PartialEq for TypeParamBound { (TypeParamBound::Lifetime(self0), TypeParamBound::Lifetime(other0)) => { self0 == other0 } + (TypeParamBound::Verbatim(self0), TypeParamBound::Verbatim(other0)) => { + TokenStreamHelper(self0) == TokenStreamHelper(other0) + } _ => false, } } @@ -2095,14 +2073,14 @@ impl PartialEq for UseTree { } } } -#[cfg(any(feature = "derive", feature = "full"))] +#[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for Variadic {} -#[cfg(any(feature = "derive", feature = "full"))] +#[cfg(feature = "full")] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl PartialEq for Variadic { fn eq(&self, other: &Self) -> bool { - self.attrs == other.attrs + self.attrs == other.attrs && self.pat == other.pat && self.comma == other.comma } } #[cfg(any(feature = "derive", feature = "full"))] @@ -2118,26 +2096,6 @@ impl PartialEq for Variant { } #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for VisCrate {} -#[cfg(any(feature = "derive", feature = "full"))] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for VisCrate { - fn eq(&self, _other: &Self) -> bool { - true - } -} -#[cfg(any(feature = "derive", feature = "full"))] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl Eq for VisPublic {} -#[cfg(any(feature = "derive", feature = "full"))] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] -impl PartialEq for VisPublic { - fn eq(&self, _other: &Self) -> bool { - true - } -} -#[cfg(any(feature = "derive", feature = "full"))] -#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] impl Eq for VisRestricted {} #[cfg(any(feature = "derive", feature = "full"))] #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))] @@ -2154,8 +2112,7 @@ impl Eq for Visibility {} impl PartialEq for Visibility { fn eq(&self, other: &Self) -> bool { match (self, other) { - (Visibility::Public(self0), Visibility::Public(other0)) => self0 == other0, - (Visibility::Crate(self0), Visibility::Crate(other0)) => self0 == other0, + (Visibility::Public(_), Visibility::Public(_)) => true, (Visibility::Restricted(self0), Visibility::Restricted(other0)) => { self0 == other0 } @@ -2182,13 +2139,12 @@ impl Eq for WherePredicate {} impl PartialEq for WherePredicate { fn eq(&self, other: &Self) -> bool { match (self, other) { - (WherePredicate::Type(self0), WherePredicate::Type(other0)) => { + (WherePredicate::Lifetime(self0), WherePredicate::Lifetime(other0)) => { self0 == other0 } - (WherePredicate::Lifetime(self0), WherePredicate::Lifetime(other0)) => { + (WherePredicate::Type(self0), WherePredicate::Type(other0)) => { self0 == other0 } - (WherePredicate::Eq(self0), WherePredicate::Eq(other0)) => self0 == other0, _ => false, } } -- cgit v1.2.3