about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2017-12-01 12:13:01 +0100
committerFelix S. Klock II <pnkfelix@pnkfx.org>2017-12-13 13:50:40 -0600
commitef64ace8aa16f05968fd46e8ee3eaa3308240d54 (patch)
tree8d9aa8addd5a2bcfd6d3c48516f93985cc3150a4
parente437e499d1ca9fa2dae69077358b3d1ffd06d27b (diff)
downloadrust-ef64ace8aa16f05968fd46e8ee3eaa3308240d54.tar.gz
rust-ef64ace8aa16f05968fd46e8ee3eaa3308240d54.zip
Allow `mir::Place` to be used as a key in hashtables.
-rw-r--r--src/librustc/mir/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs
index 64e601ab1e7..36bee69d8f0 100644
--- a/src/librustc/mir/mod.rs
+++ b/src/librustc/mir/mod.rs
@@ -1136,7 +1136,7 @@ impl<'tcx> Debug for Statement<'tcx> {
 
 /// A path to a value; something that can be evaluated without
 /// changing or disturbing program state.
-#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable)]
+#[derive(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
 pub enum Place<'tcx> {
     /// local variable
     Local(Local),
@@ -1150,7 +1150,7 @@ pub enum Place<'tcx> {
 
 /// The def-id of a static, along with its normalized type (which is
 /// stored to avoid requiring normalization when reading MIR).
-#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable)]
+#[derive(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
 pub struct Static<'tcx> {
     pub def_id: DefId,
     pub ty: Ty<'tcx>,