Derive Hash for some types

This commit is contained in:
Artur Jamro
2019-07-24 17:18:50 -07:00
committed by Dan Gohman
parent be36cc6538
commit 09ec0d4149
2 changed files with 6 additions and 6 deletions

View File

@@ -27,7 +27,7 @@ use std::vec::Vec;
/// 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
/// `into_boxed_slice`.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Hash)]
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))]
pub struct PrimaryMap<K, V>
where

View File

@@ -54,7 +54,7 @@ pub struct SignatureIndex(u32);
entity_impl!(SignatureIndex);
/// WebAssembly global.
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone, Copy, Hash)]
pub struct Global {
/// The type of the value stored in the global.
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.
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone, Copy, Hash)]
pub enum GlobalInit {
/// An `i32.const`.
I32Const(i32),
@@ -82,7 +82,7 @@ pub enum GlobalInit {
}
/// WebAssembly table.
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone, Copy, Hash)]
pub struct Table {
/// The type of data stored in elements of the table.
pub ty: TableElementType,
@@ -93,7 +93,7 @@ pub struct Table {
}
/// WebAssembly table element. Can be a function or a scalar type.
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone, Copy, Hash)]
pub enum TableElementType {
/// A scalar type.
Val(ir::Type),
@@ -102,7 +102,7 @@ pub enum TableElementType {
}
/// WebAssembly linear memory.
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone, Copy, Hash)]
pub struct Memory {
/// The minimum number of pages in the memory.
pub minimum: u32,