Skip to content

Commit

Permalink
Avoid deconstructing pointer for hashing
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Simulacrum committed Jul 5, 2020
1 parent aae1215 commit 8512d2e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/librustc_middle/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 8512d2e

Please sign in to comment.