@@ -31,7 +31,7 @@ pub enum BlockType {
3131}
3232
3333/// Represents a memory immediate in a WebAssembly memory instruction.
34- #[ derive( Debug , Copy , Clone ) ]
34+ #[ derive( Debug , Copy , Clone , Eq , PartialEq ) ]
3535pub struct MemArg {
3636 /// Alignment, stored as `n` where the actual alignment is `2^n`
3737 pub align : u8 ,
@@ -64,6 +64,16 @@ pub struct BrTable<'a> {
6464 pub ( crate ) default : u32 ,
6565}
6666
67+ impl PartialEq < Self > for BrTable < ' _ > {
68+ fn eq ( & self , other : & Self ) -> bool {
69+ self . cnt == other. cnt
70+ && self . default == other. default
71+ && self . reader . remaining_buffer ( ) == other. reader . remaining_buffer ( )
72+ }
73+ }
74+
75+ impl Eq for BrTable < ' _ > { }
76+
6777/// An IEEE binary32 immediate floating point value, represented as a u32
6878/// containing the bit pattern.
6979///
@@ -155,7 +165,7 @@ macro_rules! define_operator {
155165 /// Instructions as defined [here].
156166 ///
157167 /// [here]: https://webassembly.github.io/spec/core/binary/instructions.html
158- #[ derive( Debug , Clone ) ]
168+ #[ derive( Debug , Clone , Eq , PartialEq ) ]
159169 #[ allow( missing_docs) ]
160170 pub enum Operator <' a> {
161171 $(
@@ -397,7 +407,7 @@ impl<'a, V: VisitOperator<'a> + ?Sized> VisitOperator<'a> for Box<V> {
397407}
398408
399409/// A `try_table` entries representation.
400- #[ derive( Clone , Debug ) ]
410+ #[ derive( Clone , Debug , Eq , PartialEq ) ]
401411pub struct TryTable {
402412 /// The block type describing the try block itself.
403413 pub ty : BlockType ,
@@ -406,7 +416,7 @@ pub struct TryTable {
406416}
407417
408418/// Catch clauses that can be specified in [`TryTable`].
409- #[ derive( Copy , Clone , Debug ) ]
419+ #[ derive( Copy , Clone , Debug , Eq , PartialEq ) ]
410420#[ allow( missing_docs) ]
411421pub enum Catch {
412422 /// Equivalent of `catch`
0 commit comments