use crate::convert::TryFrom;
use crate::num::NonZeroUsize;
-use crate::{cmp, fmt, mem, num};
+use crate::{cmp, fmt, hash, mem, num};
/// A type storing a `usize` which is a power of two, and thus
/// represents a possible alignment in the rust abstract machine.
}
}
+impl hash::Hash for ValidAlign {
+ #[inline]
+ fn hash<H: hash::Hasher>(&self, state: &mut H) {
+ self.as_nonzero().hash(state)
+ }
+}
+
#[cfg(target_pointer_width = "16")]
type ValidAlignEnum = ValidAlignEnum16;
#[cfg(target_pointer_width = "32")]