about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2020-07-03 07:40:37 -0400
committerMark Rousskov <mark.simulacrum@gmail.com>2020-07-05 09:51:42 -0400
commit8512d2efdef2c41aa529f44941f4c1f0e5fdd7de (patch)
tree7c9d463f71cef8ec0a8332d0ec0a6c9405eabfab
parentaae1215f7faa3aac5ada7e82585b86f1282cd89e (diff)
downloadrust-8512d2efdef2c41aa529f44941f4c1f0e5fdd7de.tar.gz
rust-8512d2efdef2c41aa529f44941f4c1f0e5fdd7de.zip
Avoid deconstructing pointer for hashing
-rw-r--r--src/librustc_middle/ty/mod.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustc_middle/ty/mod.rs b/src/librustc_middle/ty/mod.rs
index fde99f5c270..ffb41b094dc 100644
--- a/src/librustc_middle/ty/mod.rs
+++ b/src/librustc_middle/ty/mod.rs
@@ -1621,8 +1621,9 @@ impl<'tcx> fmt::Debug for ParamEnv<'tcx> {
 
 impl<'tcx> Hash for ParamEnv<'tcx> {
     fn hash<H: Hasher>(&self, state: &mut H) {
-        self.caller_bounds().hash(state);
-        self.reveal().hash(state);
+        // List hashes as the raw pointer, so we can skip splitting into the
+        // pointer and the enum.
+        self.packed_data.hash(state);
         self.def_id.hash(state);
     }
 }