derive hash for placeholder automatically
This commit is contained in:
parent
56d5aab31d
commit
b9e6bd7fe2
1 changed files with 1 additions and 11 deletions
|
|
@ -249,22 +249,12 @@ pub struct BoundRegion {
|
|||
|
||||
pub(crate) type UniverseIndex = u32;
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Hash, Serialize)]
|
||||
pub struct Placeholder<T> {
|
||||
pub universe: UniverseIndex,
|
||||
pub bound: T,
|
||||
}
|
||||
|
||||
impl<T: std::hash::Hash> std::hash::Hash for Placeholder<T> {
|
||||
fn hash<H>(&self, state: &mut H)
|
||||
where
|
||||
H: std::hash::Hasher,
|
||||
{
|
||||
self.universe.hash(state);
|
||||
self.bound.hash(state);
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Serialize)]
|
||||
pub struct Span(usize);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue