about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexanderPortland <alexanderportland1@gmail.com>2025-08-07 09:13:02 -0700
committerAlexanderPortland <alexanderportland1@gmail.com>2025-08-07 09:13:02 -0700
commitb9e6bd7fe254d43a8804c8bf33db2f2d0845f894 (patch)
treee49914f743ed5ea0d4665ca7c16484eedaae8402
parent56d5aab31db69ad4404a93c54f1c4f48646f1ad9 (diff)
downloadrust-b9e6bd7fe254d43a8804c8bf33db2f2d0845f894.tar.gz
rust-b9e6bd7fe254d43a8804c8bf33db2f2d0845f894.zip
derive hash for placeholder automatically
-rw-r--r--compiler/rustc_public/src/ty.rs12
1 files changed, 1 insertions, 11 deletions
diff --git a/compiler/rustc_public/src/ty.rs b/compiler/rustc_public/src/ty.rs
index 957940ef22f..1b5f0ed1429 100644
--- a/compiler/rustc_public/src/ty.rs
+++ b/compiler/rustc_public/src/ty.rs
@@ -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);