]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #56864 - Zoxc:stable-hash-macro, r=michaelwoerister
authorbors <bors@rust-lang.org>
Wed, 13 Mar 2019 11:36:46 +0000 (11:36 +0000)
committerbors <bors@rust-lang.org>
Wed, 13 Mar 2019 11:36:46 +0000 (11:36 +0000)
Use derive macro for HashStable

Blocked on https://github.com/rust-lang/rust/pull/56795

1  2 
src/librustc/ty/context.rs

index 08b595c5eaa5aa1e7665860ea171e3e1521af6c0,e290ad19642b5f734eef9caf53261ac0d2f903e8..5e4274fa1c8e5b66a302b2c3e9926146d78df791
@@@ -65,6 -65,7 +65,7 @@@ use std::sync::mpsc
  use std::sync::Arc;
  use std::marker::PhantomData;
  use rustc_target::spec::abi;
+ use rustc_macros::HashStable;
  use syntax::ast;
  use syntax::attr;
  use syntax::source_map::MultiSpan;
@@@ -316,7 -317,7 +317,7 @@@ impl<'a, V> LocalTableInContextMut<'a, 
  }
  
  /// All information necessary to validate and reveal an `impl Trait` or `existential Type`
- #[derive(RustcEncodable, RustcDecodable, Debug)]
+ #[derive(RustcEncodable, RustcDecodable, Debug, HashStable)]
  pub struct ResolvedOpaqueTy<'tcx> {
      /// The revealed type as seen by this function.
      pub concrete_type: Ty<'tcx>,
@@@ -808,6 -809,7 +809,7 @@@ impl<'a, 'gcx> HashStable<StableHashing
  
  newtype_index! {
      pub struct UserTypeAnnotationIndex {
+         derive [HashStable]
          DEBUG_FORMAT = "UserType({})",
          const START_INDEX = 0,
      }
  pub type CanonicalUserTypeAnnotations<'tcx> =
      IndexVec<UserTypeAnnotationIndex, CanonicalUserTypeAnnotation<'tcx>>;
  
- #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
+ #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, HashStable)]
  pub struct CanonicalUserTypeAnnotation<'tcx> {
      pub user_ty: CanonicalUserType<'tcx>,
      pub span: Span,
@@@ -893,7 -895,7 +895,7 @@@ impl CanonicalUserType<'gcx> 
  /// A user-given type annotation attached to a constant. These arise
  /// from constants that are named via paths, like `Foo::<A>::new` and
  /// so forth.
- #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
+ #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, HashStable)]
  pub enum UserType<'tcx> {
      Ty(Ty<'tcx>),
  
@@@ -1443,6 -1445,16 +1445,6 @@@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, '
          }
      }
  
 -    // This method exercises the `in_scope_traits_map` query for all possible
 -    // values so that we have their fingerprints available in the DepGraph.
 -    // This is only required as long as we still use the old dependency tracking
 -    // which needs to have the fingerprints of all input nodes beforehand.
 -    pub fn precompute_in_scope_traits_hashes(self) {
 -        for &def_index in self.trait_map.keys() {
 -            self.in_scope_traits_map(def_index);
 -        }
 -    }
 -
      pub fn serialize_query_result_cache<E>(self,
                                             encoder: &mut E)
                                             -> Result<(), E::Error>