Skip to content

Commit b9e6bd7

Browse files
derive hash for placeholder automatically
1 parent 56d5aab commit b9e6bd7

File tree

1 file changed

+1
-11
lines changed
  • compiler/rustc_public/src

1 file changed

+1
-11
lines changed

compiler/rustc_public/src/ty.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -249,22 +249,12 @@ pub struct BoundRegion {
249249

250250
pub(crate) type UniverseIndex = u32;
251251

252-
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
252+
#[derive(Clone, Debug, Eq, PartialEq, Hash, Serialize)]
253253
pub struct Placeholder<T> {
254254
pub universe: UniverseIndex,
255255
pub bound: T,
256256
}
257257

258-
impl<T: std::hash::Hash> std::hash::Hash for Placeholder<T> {
259-
fn hash<H>(&self, state: &mut H)
260-
where
261-
H: std::hash::Hasher,
262-
{
263-
self.universe.hash(state);
264-
self.bound.hash(state);
265-
}
266-
}
267-
268258
#[derive(Clone, Copy, PartialEq, Eq, Hash, Serialize)]
269259
pub struct Span(usize);
270260

0 commit comments

Comments
 (0)