@@ -70,7 +70,8 @@ impl<'tcx> HasLocalDecls<'tcx> for Body<'tcx> {
7070/// The various "big phases" that MIR goes through.
7171///
7272/// Warning: ordering of variants is significant.
73- #[ derive( Copy , Clone , RustcEncodable , RustcDecodable , Debug , PartialEq , Eq , PartialOrd , Ord ) ]
73+ #[ derive( Copy , Clone , RustcEncodable , RustcDecodable , HashStable ,
74+ Debug , PartialEq , Eq , PartialOrd , Ord ) ]
7475pub enum MirPhase {
7576 Build = 0 ,
7677 Const = 1 ,
@@ -86,7 +87,7 @@ impl MirPhase {
8687}
8788
8889/// The lowered representation of a single function.
89- #[ derive( Clone , RustcEncodable , RustcDecodable , Debug , TypeFoldable ) ]
90+ #[ derive( Clone , RustcEncodable , RustcDecodable , Debug , HashStable , TypeFoldable ) ]
9091pub struct Body < ' tcx > {
9192 /// A list of basic blocks. References to basic block use a newtyped index type `BasicBlock`
9293 /// that indexes into this vector.
@@ -412,24 +413,6 @@ pub enum Safety {
412413 ExplicitUnsafe ( hir:: HirId ) ,
413414}
414415
415- impl_stable_hash_for ! ( struct Body <' tcx> {
416- phase,
417- basic_blocks,
418- source_scopes,
419- source_scope_local_data,
420- yield_ty,
421- generator_drop,
422- generator_layout,
423- local_decls,
424- user_type_annotations,
425- arg_count,
426- __upvar_debuginfo_codegen_only_do_not_use,
427- spread_arg,
428- control_flow_destroyed,
429- span,
430- cache
431- } ) ;
432-
433416impl < ' tcx > Index < BasicBlock > for Body < ' tcx > {
434417 type Output = BasicBlockData < ' tcx > ;
435418
@@ -609,7 +592,7 @@ pub enum LocalKind {
609592 ReturnPointer ,
610593}
611594
612- #[ derive( Clone , Debug , RustcEncodable , RustcDecodable ) ]
595+ #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable ) ]
613596pub struct VarBindingForm < ' tcx > {
614597 /// Is variable bound via `x`, `mut x`, `ref x`, or `ref mut x`?
615598 pub binding_mode : ty:: BindingMode ,
@@ -642,7 +625,7 @@ pub enum BindingForm<'tcx> {
642625}
643626
644627/// Represents what type of implicit self a function has, if any.
645- #[ derive( Clone , Copy , PartialEq , Debug , RustcEncodable , RustcDecodable ) ]
628+ #[ derive( Clone , Copy , PartialEq , Debug , RustcEncodable , RustcDecodable , HashStable ) ]
646629pub enum ImplicitSelfKind {
647630 /// Represents a `fn x(self);`.
648631 Imm ,
@@ -659,28 +642,6 @@ pub enum ImplicitSelfKind {
659642
660643CloneTypeFoldableAndLiftImpls ! { BindingForm <' tcx>, }
661644
662- impl_stable_hash_for ! ( struct self :: VarBindingForm <' tcx> {
663- binding_mode,
664- opt_ty_info,
665- opt_match_place,
666- pat_span
667- } ) ;
668-
669- impl_stable_hash_for ! ( enum self :: ImplicitSelfKind {
670- Imm ,
671- Mut ,
672- ImmRef ,
673- MutRef ,
674- None
675- } ) ;
676-
677- impl_stable_hash_for ! ( enum self :: MirPhase {
678- Build ,
679- Const ,
680- Validated ,
681- Optimized ,
682- } ) ;
683-
684645mod binding_form_impl {
685646 use crate :: ich:: StableHashingContext ;
686647 use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
@@ -707,7 +668,7 @@ mod binding_form_impl {
707668/// involved in borrow_check errors, e.g., explanations of where the
708669/// temporaries come from, when their destructors are run, and/or how
709670/// one might revise the code to satisfy the borrow checker's rules.
710- #[ derive( Clone , Debug , RustcEncodable , RustcDecodable ) ]
671+ #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable ) ]
711672pub struct BlockTailInfo {
712673 /// If `true`, then the value resulting from evaluating this tail
713674 /// expression is ignored by the block's expression context.
@@ -717,8 +678,6 @@ pub struct BlockTailInfo {
717678 pub tail_result_is_ignored : bool ,
718679}
719680
720- impl_stable_hash_for ! ( struct BlockTailInfo { tail_result_is_ignored } ) ;
721-
722681/// A MIR local.
723682///
724683/// This can be a binding declared by the user, a temporary inserted by the compiler, a function
@@ -1746,7 +1705,8 @@ pub enum PlaceBase<'tcx> {
17461705}
17471706
17481707/// We store the normalized type to avoid requiring normalization when reading MIR
1749- #[ derive( Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash , RustcEncodable , RustcDecodable ) ]
1708+ #[ derive( Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash ,
1709+ RustcEncodable , RustcDecodable , HashStable ) ]
17501710pub struct Static < ' tcx > {
17511711 pub ty : Ty < ' tcx > ,
17521712 pub kind : StaticKind < ' tcx > ,
@@ -1768,12 +1728,6 @@ pub enum StaticKind<'tcx> {
17681728 Static ,
17691729}
17701730
1771- impl_stable_hash_for ! ( struct Static <' tcx> {
1772- ty,
1773- kind,
1774- def_id
1775- } ) ;
1776-
17771731#[ derive( Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
17781732#[ derive( RustcEncodable , RustcDecodable , HashStable ) ]
17791733pub enum ProjectionElem < V , T > {
0 commit comments