@@ -70,7 +70,8 @@ impl<'tcx> HasLocalDecls<'tcx> for Body<'tcx> {
70
70
/// The various "big phases" that MIR goes through.
71
71
///
72
72
/// 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 ) ]
74
75
pub enum MirPhase {
75
76
Build = 0 ,
76
77
Const = 1 ,
@@ -86,7 +87,7 @@ impl MirPhase {
86
87
}
87
88
88
89
/// The lowered representation of a single function.
89
- #[ derive( Clone , RustcEncodable , RustcDecodable , Debug , TypeFoldable ) ]
90
+ #[ derive( Clone , RustcEncodable , RustcDecodable , Debug , HashStable , TypeFoldable ) ]
90
91
pub struct Body < ' tcx > {
91
92
/// A list of basic blocks. References to basic block use a newtyped index type `BasicBlock`
92
93
/// that indexes into this vector.
@@ -412,24 +413,6 @@ pub enum Safety {
412
413
ExplicitUnsafe ( hir:: HirId ) ,
413
414
}
414
415
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
-
433
416
impl < ' tcx > Index < BasicBlock > for Body < ' tcx > {
434
417
type Output = BasicBlockData < ' tcx > ;
435
418
@@ -609,7 +592,7 @@ pub enum LocalKind {
609
592
ReturnPointer ,
610
593
}
611
594
612
- #[ derive( Clone , Debug , RustcEncodable , RustcDecodable ) ]
595
+ #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable ) ]
613
596
pub struct VarBindingForm < ' tcx > {
614
597
/// Is variable bound via `x`, `mut x`, `ref x`, or `ref mut x`?
615
598
pub binding_mode : ty:: BindingMode ,
@@ -642,7 +625,7 @@ pub enum BindingForm<'tcx> {
642
625
}
643
626
644
627
/// 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 ) ]
646
629
pub enum ImplicitSelfKind {
647
630
/// Represents a `fn x(self);`.
648
631
Imm ,
@@ -659,28 +642,6 @@ pub enum ImplicitSelfKind {
659
642
660
643
CloneTypeFoldableAndLiftImpls ! { BindingForm <' tcx>, }
661
644
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
-
684
645
mod binding_form_impl {
685
646
use crate :: ich:: StableHashingContext ;
686
647
use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
@@ -707,7 +668,7 @@ mod binding_form_impl {
707
668
/// involved in borrow_check errors, e.g., explanations of where the
708
669
/// temporaries come from, when their destructors are run, and/or how
709
670
/// 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 ) ]
711
672
pub struct BlockTailInfo {
712
673
/// If `true`, then the value resulting from evaluating this tail
713
674
/// expression is ignored by the block's expression context.
@@ -717,8 +678,6 @@ pub struct BlockTailInfo {
717
678
pub tail_result_is_ignored : bool ,
718
679
}
719
680
720
- impl_stable_hash_for ! ( struct BlockTailInfo { tail_result_is_ignored } ) ;
721
-
722
681
/// A MIR local.
723
682
///
724
683
/// 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> {
1746
1705
}
1747
1706
1748
1707
/// 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 ) ]
1750
1710
pub struct Static < ' tcx > {
1751
1711
pub ty : Ty < ' tcx > ,
1752
1712
pub kind : StaticKind < ' tcx > ,
@@ -1768,12 +1728,6 @@ pub enum StaticKind<'tcx> {
1768
1728
Static ,
1769
1729
}
1770
1730
1771
- impl_stable_hash_for ! ( struct Static <' tcx> {
1772
- ty,
1773
- kind,
1774
- def_id
1775
- } ) ;
1776
-
1777
1731
#[ derive( Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
1778
1732
#[ derive( RustcEncodable , RustcDecodable , HashStable ) ]
1779
1733
pub enum ProjectionElem < V , T > {
0 commit comments