Skip to content

Commit b646b64

Browse files
Add Eq+PartialEq to UnresolvedPackageGroup and its dependencies (#2458)
1 parent 2b5c44d commit b646b64

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

crates/wit-parser/src/ast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,13 +1686,13 @@ fn eat_id(tokens: &mut Tokenizer<'_>, expected: &str) -> Result<Span> {
16861686
/// [`UnresolvedPackage`].
16871687
///
16881688
/// [`UnresolvedPackage`]: crate::UnresolvedPackage
1689-
#[derive(Clone, Default, Debug)]
1689+
#[derive(Clone, Default, Debug, PartialEq, Eq)]
16901690
pub struct SourceMap {
16911691
sources: Vec<Source>,
16921692
offset: u32,
16931693
}
16941694

1695-
#[derive(Clone, Debug)]
1695+
#[derive(Clone, Debug, PartialEq, Eq)]
16961696
struct Source {
16971697
offset: u32,
16981698
path: String,

crates/wit-parser/src/lib.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub type TypeId = Id<TypeDef>;
9797
/// will connect the `foreign_deps` field of this structure to packages
9898
/// previously inserted within the [`Resolve`]. Embedders are responsible for
9999
/// performing this resolution themselves.
100-
#[derive(Clone)]
100+
#[derive(Clone, PartialEq, Eq)]
101101
pub struct UnresolvedPackage {
102102
/// The namespace, name, and version information for this package.
103103
pub name: PackageName,
@@ -175,7 +175,7 @@ impl UnresolvedPackage {
175175
}
176176

177177
/// Tracks a set of packages, all pulled from the same group of WIT source files.
178-
#[derive(Clone)]
178+
#[derive(Clone, PartialEq, Eq)]
179179
pub struct UnresolvedPackageGroup {
180180
/// The "main" package in this package group which was found at the root of
181181
/// the WIT files.
@@ -190,7 +190,7 @@ pub struct UnresolvedPackageGroup {
190190
pub source_map: SourceMap,
191191
}
192192

193-
#[derive(Debug, Copy, Clone)]
193+
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
194194
#[cfg_attr(feature = "serde", derive(Serialize))]
195195
#[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))]
196196
pub enum AstItem {
@@ -467,7 +467,7 @@ impl UnresolvedPackageGroup {
467467
}
468468
}
469469

470-
#[derive(Debug, Clone)]
470+
#[derive(Debug, Clone, PartialEq, Eq)]
471471
#[cfg_attr(feature = "serde", derive(Serialize))]
472472
pub struct World {
473473
/// The WIT identifier name of this world.
@@ -516,7 +516,7 @@ impl World {
516516
}
517517
}
518518

519-
#[derive(Debug, Clone)]
519+
#[derive(Debug, Clone, PartialEq, Eq)]
520520
pub struct IncludeName {
521521
/// The name of the item
522522
pub name: String,
@@ -527,7 +527,7 @@ pub struct IncludeName {
527527

528528
/// An entry in the `includes` list of a world, representing an `include`
529529
/// statement in WIT.
530-
#[derive(Debug, Clone)]
530+
#[derive(Debug, Clone, PartialEq, Eq)]
531531
pub struct WorldInclude {
532532
/// The stability annotation on this include.
533533
pub stability: Stability,
@@ -600,7 +600,7 @@ impl WorldKey {
600600
}
601601
}
602602

603-
#[derive(Debug, Clone, PartialEq)]
603+
#[derive(Debug, Clone, PartialEq, Eq)]
604604
#[cfg_attr(feature = "serde", derive(Serialize))]
605605
#[cfg_attr(feature = "serde", serde(rename_all = "kebab-case"))]
606606
pub enum WorldItem {
@@ -654,7 +654,7 @@ impl WorldItem {
654654
}
655655
}
656656

657-
#[derive(Debug, Clone)]
657+
#[derive(Debug, Clone, PartialEq, Eq)]
658658
#[cfg_attr(feature = "serde", derive(Serialize))]
659659
pub struct Interface {
660660
/// Optionally listed name of this interface.
@@ -714,7 +714,7 @@ impl Interface {
714714
}
715715
}
716716

717-
#[derive(Debug, Clone, PartialEq)]
717+
#[derive(Debug, Clone, PartialEq, Eq)]
718718
#[cfg_attr(feature = "serde", derive(Serialize))]
719719
pub struct TypeDef {
720720
pub name: Option<String>,

0 commit comments

Comments
 (0)