Derive Hash for some types
This commit is contained in:
@@ -27,7 +27,7 @@ use std::vec::Vec;
|
|||||||
/// that it only allows indexing with the distinct `EntityRef` key type, so converting to a
|
/// that it only allows indexing with the distinct `EntityRef` key type, so converting to a
|
||||||
/// plain slice would make it easier to use incorrectly. To make a slice of a `PrimaryMap`, use
|
/// plain slice would make it easier to use incorrectly. To make a slice of a `PrimaryMap`, use
|
||||||
/// `into_boxed_slice`.
|
/// `into_boxed_slice`.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone, Hash)]
|
||||||
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
|
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
|
||||||
pub struct PrimaryMap<K, V>
|
pub struct PrimaryMap<K, V>
|
||||||
where
|
where
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ pub struct SignatureIndex(u32);
|
|||||||
entity_impl!(SignatureIndex);
|
entity_impl!(SignatureIndex);
|
||||||
|
|
||||||
/// WebAssembly global.
|
/// WebAssembly global.
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy, Hash)]
|
||||||
pub struct Global {
|
pub struct Global {
|
||||||
/// The type of the value stored in the global.
|
/// The type of the value stored in the global.
|
||||||
pub ty: ir::Type,
|
pub ty: ir::Type,
|
||||||
@@ -65,7 +65,7 @@ pub struct Global {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Globals are initialized via the four `const` operators or by referring to another import.
|
/// Globals are initialized via the four `const` operators or by referring to another import.
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy, Hash)]
|
||||||
pub enum GlobalInit {
|
pub enum GlobalInit {
|
||||||
/// An `i32.const`.
|
/// An `i32.const`.
|
||||||
I32Const(i32),
|
I32Const(i32),
|
||||||
@@ -82,7 +82,7 @@ pub enum GlobalInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// WebAssembly table.
|
/// WebAssembly table.
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy, Hash)]
|
||||||
pub struct Table {
|
pub struct Table {
|
||||||
/// The type of data stored in elements of the table.
|
/// The type of data stored in elements of the table.
|
||||||
pub ty: TableElementType,
|
pub ty: TableElementType,
|
||||||
@@ -93,7 +93,7 @@ pub struct Table {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// WebAssembly table element. Can be a function or a scalar type.
|
/// WebAssembly table element. Can be a function or a scalar type.
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy, Hash)]
|
||||||
pub enum TableElementType {
|
pub enum TableElementType {
|
||||||
/// A scalar type.
|
/// A scalar type.
|
||||||
Val(ir::Type),
|
Val(ir::Type),
|
||||||
@@ -102,7 +102,7 @@ pub enum TableElementType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// WebAssembly linear memory.
|
/// WebAssembly linear memory.
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy, Hash)]
|
||||||
pub struct Memory {
|
pub struct Memory {
|
||||||
/// The minimum number of pages in the memory.
|
/// The minimum number of pages in the memory.
|
||||||
pub minimum: u32,
|
pub minimum: u32,
|
||||||
|
|||||||
Reference in New Issue
Block a user