diff --git a/src/librustc/ich/caching_codemap_view.rs b/src/librustc/ich/caching_codemap_view.rs index 9aecd8ad836..bf47b9bb9d4 100644 --- a/src/librustc/ich/caching_codemap_view.rs +++ b/src/librustc/ich/caching_codemap_view.rs @@ -29,8 +29,8 @@ pub struct CachingCodemapView<'tcx> { time_stamp: usize, } -impl<'tcx> CachingCodemapView<'tcx> { - pub fn new<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>) -> CachingCodemapView<'tcx> { +impl<'gcx> CachingCodemapView<'gcx> { + pub fn new<'a, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>) -> CachingCodemapView<'gcx> { let codemap = tcx.sess.codemap(); let files = codemap.files(); let first_file = files[0].clone(); diff --git a/src/librustc/ich/hcx.rs b/src/librustc/ich/hcx.rs index a8355488941..2784a7bd024 100644 --- a/src/librustc/ich/hcx.rs +++ b/src/librustc/ich/hcx.rs @@ -33,9 +33,9 @@ use rustc_data_structures::accumulate_vec::AccumulateVec; /// enough information to transform DefIds and HirIds into stable DefPaths (i.e. /// a reference to the TyCtxt) and it holds a few caches for speeding up various /// things (e.g. each DefId/DefPath is only hashed once). -pub struct StableHashingContext<'a, 'tcx: 'a> { - tcx: ty::TyCtxt<'a, 'tcx, 'tcx>, - codemap: CachingCodemapView<'tcx>, +pub struct StableHashingContext<'a, 'gcx: 'a+'tcx, 'tcx: 'a> { + tcx: ty::TyCtxt<'a, 'gcx, 'tcx>, + codemap: CachingCodemapView<'gcx>, hash_spans: bool, hash_bodies: bool, overflow_checks_enabled: bool, @@ -51,9 +51,9 @@ pub enum NodeIdHashingMode { HashTraitsInScope, } -impl<'a, 'tcx: 'a> StableHashingContext<'a, 'tcx> { +impl<'a, 'gcx, 'tcx> StableHashingContext<'a, 'gcx, 'tcx> { - pub fn new(tcx: ty::TyCtxt<'a, 'tcx, 'tcx>) -> Self { + pub fn new(tcx: ty::TyCtxt<'a, 'gcx, 'tcx>) -> Self { let hash_spans_initial = tcx.sess.opts.debuginfo != NoDebugInfo; let check_overflow_initial = tcx.sess.overflow_checks(); @@ -111,7 +111,7 @@ impl<'a, 'tcx: 'a> StableHashingContext<'a, 'tcx> { } #[inline] - pub fn tcx(&self) -> ty::TyCtxt<'a, 'tcx, 'tcx> { + pub fn tcx(&self) -> ty::TyCtxt<'a, 'gcx, 'tcx> { self.tcx } @@ -131,7 +131,7 @@ impl<'a, 'tcx: 'a> StableHashingContext<'a, 'tcx> { } #[inline] - pub fn codemap(&mut self) -> &mut CachingCodemapView<'tcx> { + pub fn codemap(&mut self) -> &mut CachingCodemapView<'gcx> { &mut self.codemap } @@ -195,9 +195,9 @@ impl<'a, 'tcx: 'a> StableHashingContext<'a, 'tcx> { } -impl<'a, 'tcx> HashStable> for ast::NodeId { +impl<'a, 'gcx, 'tcx> HashStable> for ast::NodeId { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { match hcx.node_id_hashing_mode { NodeIdHashingMode::Ignore => { @@ -230,7 +230,7 @@ impl<'a, 'tcx> HashStable> for ast::NodeId { } } -impl<'a, 'tcx> HashStable> for Span { +impl<'a, 'gcx, 'tcx> HashStable> for Span { // Hash a span in a stable way. We can't directly hash the span's BytePos // fields (that would be similar to hashing pointers, since those are just @@ -242,7 +242,7 @@ impl<'a, 'tcx> HashStable> for Span { // Also, hashing filenames is expensive so we avoid doing it twice when the // span starts and ends in the same file, which is almost always the case. fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { use syntax_pos::Pos; @@ -305,15 +305,16 @@ impl<'a, 'tcx> HashStable> for Span { } } -pub fn hash_stable_hashmap<'a, 'tcx, K, V, R, SK, F, W>(hcx: &mut StableHashingContext<'a, 'tcx>, - hasher: &mut StableHasher, - map: &HashMap, - extract_stable_key: F) +pub fn hash_stable_hashmap<'a, 'gcx, 'tcx, K, V, R, SK, F, W>( + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, + hasher: &mut StableHasher, + map: &HashMap, + extract_stable_key: F) where K: Eq + std_hash::Hash, - V: HashStable>, + V: HashStable>, R: std_hash::BuildHasher, - SK: HashStable> + Ord + Clone, - F: Fn(&mut StableHashingContext<'a, 'tcx>, &K) -> SK, + SK: HashStable> + Ord + Clone, + F: Fn(&mut StableHashingContext<'a, 'gcx, 'tcx>, &K) -> SK, W: StableHasherResult, { let mut keys: Vec<_> = map.keys() @@ -327,14 +328,15 @@ pub fn hash_stable_hashmap<'a, 'tcx, K, V, R, SK, F, W>(hcx: &mut StableHashingC } } -pub fn hash_stable_hashset<'a, 'tcx, K, R, SK, F, W>(hcx: &mut StableHashingContext<'a, 'tcx>, - hasher: &mut StableHasher, - set: &HashSet, - extract_stable_key: F) +pub fn hash_stable_hashset<'a, 'tcx, 'gcx, K, R, SK, F, W>( + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, + hasher: &mut StableHasher, + set: &HashSet, + extract_stable_key: F) where K: Eq + std_hash::Hash, R: std_hash::BuildHasher, - SK: HashStable> + Ord + Clone, - F: Fn(&mut StableHashingContext<'a, 'tcx>, &K) -> SK, + SK: HashStable> + Ord + Clone, + F: Fn(&mut StableHashingContext<'a, 'gcx, 'tcx>, &K) -> SK, W: StableHasherResult, { let mut keys: Vec<_> = set.iter() @@ -344,10 +346,11 @@ pub fn hash_stable_hashset<'a, 'tcx, K, R, SK, F, W>(hcx: &mut StableHashingCont keys.hash_stable(hcx, hasher); } -pub fn hash_stable_nodemap<'a, 'tcx, V, W>(hcx: &mut StableHashingContext<'a, 'tcx>, - hasher: &mut StableHasher, - map: &NodeMap) - where V: HashStable>, +pub fn hash_stable_nodemap<'a, 'tcx, 'gcx, V, W>( + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, + hasher: &mut StableHasher, + map: &NodeMap) + where V: HashStable>, W: StableHasherResult, { hash_stable_hashmap(hcx, hasher, map, |hcx, node_id| { @@ -356,14 +359,15 @@ pub fn hash_stable_nodemap<'a, 'tcx, V, W>(hcx: &mut StableHashingContext<'a, 't } -pub fn hash_stable_btreemap<'a, 'tcx, K, V, SK, F, W>(hcx: &mut StableHashingContext<'a, 'tcx>, - hasher: &mut StableHasher, - map: &BTreeMap, - extract_stable_key: F) +pub fn hash_stable_btreemap<'a, 'tcx, 'gcx, K, V, SK, F, W>( + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, + hasher: &mut StableHasher, + map: &BTreeMap, + extract_stable_key: F) where K: Eq + Ord, - V: HashStable>, - SK: HashStable> + Ord + Clone, - F: Fn(&mut StableHashingContext<'a, 'tcx>, &K) -> SK, + V: HashStable>, + SK: HashStable> + Ord + Clone, + F: Fn(&mut StableHashingContext<'a, 'gcx, 'tcx>, &K) -> SK, W: StableHasherResult, { let mut keys: Vec<_> = map.keys() diff --git a/src/librustc/ich/impls_hir.rs b/src/librustc/ich/impls_hir.rs index c582cac67e2..678ec797a86 100644 --- a/src/librustc/ich/impls_hir.rs +++ b/src/librustc/ich/impls_hir.rs @@ -21,20 +21,20 @@ use syntax::ast; use rustc_data_structures::stable_hasher::{HashStable, StableHasher, StableHasherResult}; -impl<'a, 'tcx> HashStable> for DefId { +impl<'a, 'gcx, 'tcx> HashStable> for DefId { #[inline] fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { hcx.def_path_hash(*self).hash_stable(hcx, hasher); } } -impl<'a, 'tcx> HashStable> for hir::HirId { +impl<'a, 'gcx, 'tcx> HashStable> for hir::HirId { #[inline] fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let hir::HirId { owner, @@ -55,9 +55,9 @@ impl_stable_hash_for!(tuple_struct hir::ItemLocalId { index }); // want to pick up on a reference changing its target, so we hash the NodeIds // in "DefPath Mode". -impl<'a, 'tcx> HashStable> for hir::ItemId { +impl<'a, 'gcx, 'tcx> HashStable> for hir::ItemId { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let hir::ItemId { id @@ -69,9 +69,9 @@ impl<'a, 'tcx> HashStable> for hir::ItemId { } } -impl<'a, 'tcx> HashStable> for hir::TraitItemId { +impl<'a, 'gcx, 'tcx> HashStable> for hir::TraitItemId { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let hir::TraitItemId { node_id @@ -83,9 +83,9 @@ impl<'a, 'tcx> HashStable> for hir::TraitItemId { } } -impl<'a, 'tcx> HashStable> for hir::ImplItemId { +impl<'a, 'gcx, 'tcx> HashStable> for hir::ImplItemId { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let hir::ImplItemId { node_id @@ -215,9 +215,9 @@ impl_stable_hash_for!(struct hir::TypeBinding { span }); -impl<'a, 'tcx> HashStable> for hir::Ty { +impl<'a, 'gcx, 'tcx> HashStable> for hir::Ty { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let node_id_hashing_mode = match self.node { hir::TySlice(..) | @@ -299,9 +299,9 @@ impl_stable_hash_for!(enum hir::FunctionRetTy { Return(t) }); -impl<'a, 'tcx> HashStable> for hir::TraitRef { +impl<'a, 'gcx, 'tcx> HashStable> for hir::TraitRef { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let hir::TraitRef { ref path, @@ -338,9 +338,9 @@ impl_stable_hash_for!(struct hir::MacroDef { }); -impl<'a, 'tcx> HashStable> for hir::Block { +impl<'a, 'gcx, 'tcx> HashStable> for hir::Block { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let hir::Block { ref stmts, @@ -386,9 +386,9 @@ impl<'a, 'tcx> HashStable> for hir::Block { } } -impl<'a, 'tcx> HashStable> for hir::Pat { +impl<'a, 'gcx, 'tcx> HashStable> for hir::Pat { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let node_id_hashing_mode = match self.node { hir::PatKind::Wild | @@ -529,9 +529,9 @@ impl_stable_hash_for!(enum hir::UnsafeSource { UserProvided }); -impl<'a, 'tcx> HashStable> for hir::Expr { +impl<'a, 'gcx, 'tcx> HashStable> for hir::Expr { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { hcx.while_hashing_hir_bodies(true, |hcx| { let hir::Expr { @@ -652,9 +652,9 @@ impl_stable_hash_for!(enum hir::LoopSource { ForLoop }); -impl<'a, 'tcx> HashStable> for hir::MatchSource { +impl<'a, 'gcx, 'tcx> HashStable> for hir::MatchSource { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { use hir::MatchSource; @@ -703,9 +703,9 @@ impl_stable_hash_for!(enum hir::ScopeTarget { Loop(loop_id_result) }); -impl<'a, 'tcx> HashStable> for ast::Ident { +impl<'a, 'gcx, 'tcx> HashStable> for ast::Ident { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let ast::Ident { ref name, @@ -716,9 +716,9 @@ impl<'a, 'tcx> HashStable> for ast::Ident { } } -impl<'a, 'tcx> HashStable> for hir::TraitItem { +impl<'a, 'gcx, 'tcx> HashStable> for hir::TraitItem { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let hir::TraitItem { id, @@ -749,9 +749,9 @@ impl_stable_hash_for!(enum hir::TraitItemKind { Type(bounds, rhs) }); -impl<'a, 'tcx> HashStable> for hir::ImplItem { +impl<'a, 'gcx, 'tcx> HashStable> for hir::ImplItem { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let hir::ImplItem { id, @@ -781,9 +781,9 @@ impl_stable_hash_for!(enum hir::ImplItemKind { Type(t) }); -impl<'a, 'tcx> HashStable> for hir::Visibility { +impl<'a, 'gcx, 'tcx> HashStable> for hir::Visibility { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); match *self { @@ -802,9 +802,9 @@ impl<'a, 'tcx> HashStable> for hir::Visibility { } } -impl<'a, 'tcx> HashStable> for hir::Defaultness { +impl<'a, 'gcx, 'tcx> HashStable> for hir::Defaultness { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); match *self { @@ -823,9 +823,9 @@ impl_stable_hash_for!(enum hir::ImplPolarity { Negative }); -impl<'a, 'tcx> HashStable> for hir::Mod { +impl<'a, 'gcx, 'tcx> HashStable> for hir::Mod { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let hir::Mod { inner, @@ -878,9 +878,9 @@ impl_stable_hash_for!(enum hir::VariantData { Unit(id) }); -impl<'a, 'tcx> HashStable> for hir::Item { +impl<'a, 'gcx, 'tcx> HashStable> for hir::Item { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let node_id_hashing_mode = match self.node { hir::ItemExternCrate(..) | @@ -961,9 +961,10 @@ impl_stable_hash_for!(struct hir::ImplItemRef { defaultness }); -impl<'a, 'tcx> HashStable> for hir::AssociatedItemKind { +impl<'a, 'gcx, 'tcx> HashStable> +for hir::AssociatedItemKind { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); match *self { @@ -1008,9 +1009,9 @@ impl_stable_hash_for!(struct hir::Body { value }); -impl<'a, 'tcx> HashStable> for hir::BodyId { +impl<'a, 'gcx, 'tcx> HashStable> for hir::BodyId { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { if hcx.hash_bodies() { hcx.tcx().hir.body(*self).hash_stable(hcx, hasher); @@ -1024,9 +1025,9 @@ impl_stable_hash_for!(struct hir::InlineAsmOutput { is_indirect }); -impl<'a, 'tcx> HashStable> for hir::GlobalAsm { +impl<'a, 'gcx, 'tcx> HashStable> for hir::GlobalAsm { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let hir::GlobalAsm { asm, @@ -1037,9 +1038,9 @@ impl<'a, 'tcx> HashStable> for hir::GlobalAsm { } } -impl<'a, 'tcx> HashStable> for hir::InlineAsm { +impl<'a, 'gcx, 'tcx> HashStable> for hir::InlineAsm { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let hir::InlineAsm { asm, @@ -1114,10 +1115,11 @@ impl_stable_hash_for!(enum hir::Constness { NotConst }); -impl<'a, 'tcx> HashStable> for hir::def_id::DefIndex { +impl<'a, 'gcx, 'tcx> HashStable> +for hir::def_id::DefIndex { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { DefId::local(*self).hash_stable(hcx, hasher); } @@ -1129,9 +1131,10 @@ impl_stable_hash_for!(struct hir::def::Export { span }); -impl<'a, 'tcx> HashStable> for ::middle::lang_items::LangItem { +impl<'a, 'gcx, 'tcx> HashStable> +for ::middle::lang_items::LangItem { fn hash_stable(&self, - _: &mut StableHashingContext<'a, 'tcx>, + _: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { ::std::hash::Hash::hash(self, hasher); } diff --git a/src/librustc/ich/impls_mir.rs b/src/librustc/ich/impls_mir.rs index edaeb596fe5..ae2bea3027d 100644 --- a/src/librustc/ich/impls_mir.rs +++ b/src/librustc/ich/impls_mir.rs @@ -32,10 +32,11 @@ impl_stable_hash_for!(struct mir::LocalDecl<'tcx> { impl_stable_hash_for!(struct mir::UpvarDecl { debug_name, by_ref }); impl_stable_hash_for!(struct mir::BasicBlockData<'tcx> { statements, terminator, is_cleanup }); -impl<'a, 'tcx> HashStable> for mir::Terminator<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> +for mir::Terminator<'tcx> { #[inline] fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let mir::Terminator { ref kind, @@ -72,59 +73,61 @@ impl<'a, 'tcx> HashStable> for mir::Terminator<'t } -impl<'a, 'tcx> HashStable> for mir::Local { +impl<'a, 'gcx, 'tcx> HashStable> for mir::Local { #[inline] fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { use rustc_data_structures::indexed_vec::Idx; self.index().hash_stable(hcx, hasher); } } -impl<'a, 'tcx> HashStable> for mir::BasicBlock { +impl<'a, 'gcx, 'tcx> HashStable> for mir::BasicBlock { #[inline] fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { use rustc_data_structures::indexed_vec::Idx; self.index().hash_stable(hcx, hasher); } } -impl<'a, 'tcx> HashStable> for mir::Field { +impl<'a, 'gcx, 'tcx> HashStable> for mir::Field { #[inline] fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { use rustc_data_structures::indexed_vec::Idx; self.index().hash_stable(hcx, hasher); } } -impl<'a, 'tcx> HashStable> for mir::VisibilityScope { +impl<'a, 'gcx, 'tcx> HashStable> +for mir::VisibilityScope { #[inline] fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { use rustc_data_structures::indexed_vec::Idx; self.index().hash_stable(hcx, hasher); } } -impl<'a, 'tcx> HashStable> for mir::Promoted { +impl<'a, 'gcx, 'tcx> HashStable> for mir::Promoted { #[inline] fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { use rustc_data_structures::indexed_vec::Idx; self.index().hash_stable(hcx, hasher); } } -impl<'a, 'tcx> HashStable> for mir::TerminatorKind<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> +for mir::TerminatorKind<'tcx> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); @@ -182,9 +185,10 @@ impl<'a, 'tcx> HashStable> for mir::TerminatorKin } } -impl<'a, 'tcx> HashStable> for mir::AssertMessage<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> +for mir::AssertMessage<'tcx> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); @@ -202,9 +206,10 @@ impl<'a, 'tcx> HashStable> for mir::AssertMessage impl_stable_hash_for!(struct mir::Statement<'tcx> { source_info, kind }); -impl<'a, 'tcx> HashStable> for mir::StatementKind<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> +for mir::StatementKind<'tcx> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); @@ -231,9 +236,9 @@ impl<'a, 'tcx> HashStable> for mir::StatementKind } } -impl<'a, 'tcx> HashStable> for mir::Lvalue<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> for mir::Lvalue<'tcx> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); match *self { @@ -250,12 +255,13 @@ impl<'a, 'tcx> HashStable> for mir::Lvalue<'tcx> } } -impl<'a, 'tcx, B, V> HashStable> for mir::Projection<'tcx, B, V> - where B: HashStable>, - V: HashStable> +impl<'a, 'gcx, 'tcx, B, V> HashStable> +for mir::Projection<'tcx, B, V> + where B: HashStable>, + V: HashStable> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let mir::Projection { ref base, @@ -267,11 +273,12 @@ impl<'a, 'tcx, B, V> HashStable> for mir::Project } } -impl<'a, 'tcx, V> HashStable> for mir::ProjectionElem<'tcx, V> - where V: HashStable> +impl<'a, 'gcx, 'tcx, V> HashStable> +for mir::ProjectionElem<'tcx, V> + where V: HashStable> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); match *self { @@ -302,9 +309,9 @@ impl<'a, 'tcx, V> HashStable> for mir::Projection impl_stable_hash_for!(struct mir::VisibilityScopeData { span, parent_scope }); -impl<'a, 'tcx> HashStable> for mir::Operand<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> for mir::Operand<'tcx> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); @@ -319,9 +326,9 @@ impl<'a, 'tcx> HashStable> for mir::Operand<'tcx> } } -impl<'a, 'tcx> HashStable> for mir::Rvalue<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> for mir::Rvalue<'tcx> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); @@ -379,9 +386,10 @@ impl_stable_hash_for!(enum mir::CastKind { Unsize }); -impl<'a, 'tcx> HashStable> for mir::AggregateKind<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> +for mir::AggregateKind<'tcx> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); match *self { @@ -435,9 +443,9 @@ impl_stable_hash_for!(enum mir::NullOp { impl_stable_hash_for!(struct mir::Constant<'tcx> { span, ty, literal }); -impl<'a, 'tcx> HashStable> for mir::Literal<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> for mir::Literal<'tcx> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); match *self { diff --git a/src/librustc/ich/impls_syntax.rs b/src/librustc/ich/impls_syntax.rs index f6ad97445e8..995f797df2f 100644 --- a/src/librustc/ich/impls_syntax.rs +++ b/src/librustc/ich/impls_syntax.rs @@ -27,20 +27,21 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher, StableHasherResult}; use rustc_data_structures::accumulate_vec::AccumulateVec; -impl<'a, 'tcx> HashStable> for ::syntax::symbol::InternedString { +impl<'a, 'gcx, 'tcx> HashStable> +for ::syntax::symbol::InternedString { #[inline] fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let s: &str = &**self; s.hash_stable(hcx, hasher); } } -impl<'a, 'tcx> HashStable> for ast::Name { +impl<'a, 'gcx, 'tcx> HashStable> for ast::Name { #[inline] fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { self.as_str().hash_stable(hcx, hasher); } @@ -82,9 +83,10 @@ impl_stable_hash_for!(enum ::syntax::abi::Abi { impl_stable_hash_for!(struct ::syntax::attr::Deprecation { since, note }); impl_stable_hash_for!(struct ::syntax::attr::Stability { level, feature, rustc_depr }); -impl<'a, 'tcx> HashStable> for ::syntax::attr::StabilityLevel { +impl<'a, 'gcx, 'tcx> HashStable> +for ::syntax::attr::StabilityLevel { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); match *self { @@ -135,9 +137,9 @@ impl_stable_hash_for!(struct ::syntax::ast::Lifetime { id, span, ident }); impl_stable_hash_for!(enum ::syntax::ast::StrStyle { Cooked, Raw(pounds) }); impl_stable_hash_for!(enum ::syntax::ast::AttrStyle { Outer, Inner }); -impl<'a, 'tcx> HashStable> for [ast::Attribute] { +impl<'a, 'gcx, 'tcx> HashStable> for [ast::Attribute] { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { // Some attributes are always ignored during hashing. let filtered: AccumulateVec<[&ast::Attribute; 8]> = self @@ -155,9 +157,9 @@ impl<'a, 'tcx> HashStable> for [ast::Attribute] { } } -impl<'a, 'tcx> HashStable> for ast::Attribute { +impl<'a, 'gcx, 'tcx> HashStable> for ast::Attribute { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { // Make sure that these have been filtered out. debug_assert!(self.name().map(|name| !hcx.is_ignored_attr(name)).unwrap_or(true)); @@ -184,9 +186,10 @@ impl<'a, 'tcx> HashStable> for ast::Attribute { } } -impl<'a, 'tcx> HashStable> for tokenstream::TokenTree { +impl<'a, 'gcx, 'tcx> HashStable> +for tokenstream::TokenTree { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); match *self { @@ -205,9 +208,10 @@ impl<'a, 'tcx> HashStable> for tokenstream::Token } } -impl<'a, 'tcx> HashStable> for tokenstream::TokenStream { +impl<'a, 'gcx, 'tcx> HashStable> +for tokenstream::TokenStream { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { for sub_tt in self.trees() { sub_tt.hash_stable(hcx, hasher); @@ -215,8 +219,8 @@ impl<'a, 'tcx> HashStable> for tokenstream::Token } } -fn hash_token<'a, 'tcx, W: StableHasherResult>(token: &token::Token, - hcx: &mut StableHashingContext<'a, 'tcx>, +fn hash_token<'a, 'gcx, 'tcx, W: StableHasherResult>(token: &token::Token, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher, error_reporting_span: Span) { mem::discriminant(token).hash_stable(hcx, hasher); @@ -322,9 +326,9 @@ impl_stable_hash_for!(enum ::syntax::ast::MetaItemKind { NameValue(lit) }); -impl<'a, 'tcx> HashStable> for FileMap { +impl<'a, 'gcx, 'tcx> HashStable> for FileMap { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let FileMap { ref name, diff --git a/src/librustc/ich/impls_ty.rs b/src/librustc/ich/impls_ty.rs index a362dc31ff1..4e78d79ef87 100644 --- a/src/librustc/ich/impls_ty.rs +++ b/src/librustc/ich/impls_ty.rs @@ -19,27 +19,30 @@ use std::mem; use syntax_pos::symbol::InternedString; use ty; -impl<'a, 'tcx, T> HashStable> for &'tcx ty::Slice - where T: HashStable> { +impl<'a, 'gcx, 'tcx, T> HashStable> +for &'tcx ty::Slice + where T: HashStable> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { (&self[..]).hash_stable(hcx, hasher); } } -impl<'a, 'tcx> HashStable> for ty::subst::Kind<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> +for ty::subst::Kind<'tcx> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { self.as_type().hash_stable(hcx, hasher); self.as_region().hash_stable(hcx, hasher); } } -impl<'a, 'tcx> HashStable> for ty::RegionKind { +impl<'a, 'gcx, 'tcx> HashStable> +for ty::RegionKind { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); match *self { @@ -72,9 +75,10 @@ impl<'a, 'tcx> HashStable> for ty::RegionKind { } } -impl<'a, 'tcx> HashStable> for ty::adjustment::AutoBorrow<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> +for ty::adjustment::AutoBorrow<'tcx> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); match *self { @@ -89,9 +93,10 @@ impl<'a, 'tcx> HashStable> for ty::adjustment::Au } } -impl<'a, 'tcx> HashStable> for ty::adjustment::Adjust<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> +for ty::adjustment::Adjust<'tcx> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); match *self { @@ -122,9 +127,10 @@ impl_stable_hash_for!(enum ty::BorrowKind { MutBorrow }); -impl<'a, 'tcx> HashStable> for ty::UpvarCapture<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> +for ty::UpvarCapture<'tcx> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); match *self { @@ -143,11 +149,11 @@ impl_stable_hash_for!(struct ty::FnSig<'tcx> { abi }); -impl<'a, 'tcx, T> HashStable> for ty::Binder - where T: HashStable> + ty::fold::TypeFoldable<'tcx> +impl<'a, 'gcx, 'tcx, T> HashStable> for ty::Binder + where T: HashStable> + ty::fold::TypeFoldable<'tcx> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { hcx.tcx().anonymize_late_bound_regions(self).0.hash_stable(hcx, hasher); } @@ -166,12 +172,13 @@ impl_stable_hash_for!(struct ty::TraitPredicate<'tcx> { trait_ref }); impl_stable_hash_for!(tuple_struct ty::EquatePredicate<'tcx> { t1, t2 }); impl_stable_hash_for!(struct ty::SubtypePredicate<'tcx> { a_is_expected, a, b }); -impl<'a, 'tcx, A, B> HashStable> for ty::OutlivesPredicate - where A: HashStable>, - B: HashStable>, +impl<'a, 'gcx, 'tcx, A, B> HashStable> +for ty::OutlivesPredicate + where A: HashStable>, + B: HashStable>, { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let ty::OutlivesPredicate(ref a, ref b) = *self; a.hash_stable(hcx, hasher); @@ -183,9 +190,9 @@ impl_stable_hash_for!(struct ty::ProjectionPredicate<'tcx> { projection_ty, ty } impl_stable_hash_for!(struct ty::ProjectionTy<'tcx> { trait_ref, item_def_id }); -impl<'a, 'tcx> HashStable> for ty::Predicate<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> for ty::Predicate<'tcx> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); match *self { @@ -221,9 +228,9 @@ impl<'a, 'tcx> HashStable> for ty::Predicate<'tcx } } -impl<'a, 'tcx> HashStable> for ty::AdtFlags { +impl<'a, 'gcx, 'tcx> HashStable> for ty::AdtFlags { fn hash_stable(&self, - _: &mut StableHashingContext<'a, 'tcx>, + _: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { std_hash::Hash::hash(self, hasher); } @@ -248,10 +255,10 @@ impl_stable_hash_for!(struct ty::FieldDef { vis }); -impl<'a, 'tcx> HashStable> +impl<'a, 'gcx, 'tcx> HashStable> for ::middle::const_val::ConstVal<'tcx> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { use middle::const_val::ConstVal; @@ -324,9 +331,9 @@ impl_stable_hash_for!(enum ty::adjustment::CustomCoerceUnsized { Struct(index) }); -impl<'a, 'tcx> HashStable> for ty::Generics { +impl<'a, 'gcx, 'tcx> HashStable> for ty::Generics { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let ty::Generics { parent, @@ -350,9 +357,10 @@ impl<'a, 'tcx> HashStable> for ty::Generics { } } -impl<'a, 'tcx> HashStable> for ty::RegionParameterDef { +impl<'a, 'gcx, 'tcx> HashStable> +for ty::RegionParameterDef { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let ty::RegionParameterDef { name, @@ -379,12 +387,12 @@ impl_stable_hash_for!(struct ty::TypeParameterDef { }); -impl<'a, 'tcx, T> HashStable> +impl<'a, 'gcx, 'tcx, T> HashStable> for ::middle::resolve_lifetime::Set1 - where T: HashStable> + where T: HashStable> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { use middle::resolve_lifetime::Set1; @@ -427,10 +435,11 @@ impl_stable_hash_for!(enum ty::cast::CastKind { FnPtrAddrCast }); -impl<'a, 'tcx> HashStable> for ::middle::region::CodeExtent +impl<'a, 'gcx, 'tcx> HashStable> +for ::middle::region::CodeExtent { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { use middle::region::CodeExtent; @@ -472,10 +481,11 @@ impl_stable_hash_for!(enum ty::BoundRegion { BrEnv }); -impl<'a, 'tcx> HashStable> for ty::TypeVariants<'tcx> +impl<'a, 'gcx, 'tcx> HashStable> +for ty::TypeVariants<'tcx> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { use ty::TypeVariants::*; @@ -563,10 +573,11 @@ impl_stable_hash_for!(struct ty::TypeAndMut<'tcx> { mutbl }); -impl<'a, 'tcx> HashStable> for ty::ExistentialPredicate<'tcx> +impl<'a, 'gcx, 'tcx> HashStable> +for ty::ExistentialPredicate<'tcx> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); match *self { @@ -595,9 +606,10 @@ impl_stable_hash_for!(struct ty::ExistentialProjection<'tcx> { }); -impl<'a, 'tcx> HashStable> for ty::TypeckTables<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> +for ty::TypeckTables<'tcx> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let ty::TypeckTables { ref type_dependent_defs, diff --git a/src/librustc/macros.rs b/src/librustc/macros.rs index c18e585f795..f814f941b06 100644 --- a/src/librustc/macros.rs +++ b/src/librustc/macros.rs @@ -73,10 +73,10 @@ macro_rules! __impl_stable_hash_field { #[macro_export] macro_rules! impl_stable_hash_for { (enum $enum_name:path { $( $variant:ident $( ( $($arg:ident),* ) )* ),* }) => { - impl<'a, 'tcx> ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a, 'tcx>> for $enum_name { + impl<'a, 'gcx, 'tcx> ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a, 'gcx, 'tcx>> for $enum_name { #[inline] fn hash_stable(&self, - __ctx: &mut $crate::ich::StableHashingContext<'a, 'tcx>, + __ctx: &mut $crate::ich::StableHashingContext<'a, 'gcx, 'tcx>, __hasher: &mut ::rustc_data_structures::stable_hasher::StableHasher) { use $enum_name::*; ::std::mem::discriminant(self).hash_stable(__ctx, __hasher); @@ -92,10 +92,10 @@ macro_rules! impl_stable_hash_for { } }; (struct $struct_name:path { $($field:ident),* }) => { - impl<'a, 'tcx> ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a, 'tcx>> for $struct_name { + impl<'a, 'gcx, 'tcx> ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a, 'gcx, 'tcx>> for $struct_name { #[inline] fn hash_stable(&self, - __ctx: &mut $crate::ich::StableHashingContext<'a, 'tcx>, + __ctx: &mut $crate::ich::StableHashingContext<'a, 'gcx, 'tcx>, __hasher: &mut ::rustc_data_structures::stable_hasher::StableHasher) { let $struct_name { $(ref $field),* @@ -106,10 +106,10 @@ macro_rules! impl_stable_hash_for { } }; (tuple_struct $struct_name:path { $($field:ident),* }) => { - impl<'a, 'tcx> ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a, 'tcx>> for $struct_name { + impl<'a, 'gcx, 'tcx> ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a, 'gcx, 'tcx>> for $struct_name { #[inline] fn hash_stable(&self, - __ctx: &mut $crate::ich::StableHashingContext<'a, 'tcx>, + __ctx: &mut $crate::ich::StableHashingContext<'a, 'gcx, 'tcx>, __hasher: &mut ::rustc_data_structures::stable_hasher::StableHasher) { let $struct_name ( $(ref $field),* @@ -125,11 +125,11 @@ macro_rules! impl_stable_hash_for { macro_rules! impl_stable_hash_for_spanned { ($T:path) => ( - impl<'a, 'tcx> HashStable> for ::syntax::codemap::Spanned<$T> + impl<'a, 'gcx, 'tcx> HashStable> for ::syntax::codemap::Spanned<$T> { #[inline] fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { self.node.hash_stable(hcx, hasher); self.span.hash_stable(hcx, hasher); diff --git a/src/librustc/mir/cache.rs b/src/librustc/mir/cache.rs index 799686ceca4..73c702fedb8 100644 --- a/src/librustc/mir/cache.rs +++ b/src/librustc/mir/cache.rs @@ -35,9 +35,9 @@ impl serialize::Decodable for Cache { } } -impl<'a, 'tcx> HashStable> for Cache { +impl<'a, 'gcx, 'tcx> HashStable> for Cache { fn hash_stable(&self, - _: &mut StableHashingContext<'a, 'tcx>, + _: &mut StableHashingContext<'a, 'gcx, 'tcx>, _: &mut StableHasher) { // do nothing } diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 653021119aa..afa2da3d561 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -465,9 +465,9 @@ impl<'tcx> Hash for TyS<'tcx> { } } -impl<'a, 'tcx> HashStable> for ty::TyS<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> for ty::TyS<'tcx> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let ty::TyS { ref sty, @@ -1318,9 +1318,9 @@ impl<'tcx> serialize::UseSpecializedEncodable for &'tcx AdtDef { impl<'tcx> serialize::UseSpecializedDecodable for &'tcx AdtDef {} -impl<'a, 'tcx> HashStable> for AdtDef { +impl<'a, 'gcx, 'tcx> HashStable> for AdtDef { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let ty::AdtDef { did, diff --git a/src/librustc_incremental/calculate_svh/mod.rs b/src/librustc_incremental/calculate_svh/mod.rs index be4d610a895..7831ae3092f 100644 --- a/src/librustc_incremental/calculate_svh/mod.rs +++ b/src/librustc_incremental/calculate_svh/mod.rs @@ -94,7 +94,7 @@ impl<'a> ::std::ops::Index<&'a DepNode> for IncrementalHashesMap { } struct ComputeItemHashesVisitor<'a, 'tcx: 'a> { - hcx: StableHashingContext<'a, 'tcx>, + hcx: StableHashingContext<'a, 'tcx, 'tcx>, hashes: IncrementalHashesMap, } @@ -103,7 +103,7 @@ impl<'a, 'tcx: 'a> ComputeItemHashesVisitor<'a, 'tcx> { dep_node: DepNode, hash_bodies: bool, item_like: T) - where T: HashStable> + where T: HashStable> { if !hash_bodies && !self.hcx.tcx().sess.opts.build_dep_graph() { // If we just need the hashes in order to compute the SVH, we don't diff --git a/src/librustc_metadata/isolated_encoder.rs b/src/librustc_metadata/isolated_encoder.rs index ed1680fbfae..c4116489357 100644 --- a/src/librustc_metadata/isolated_encoder.rs +++ b/src/librustc_metadata/isolated_encoder.rs @@ -23,7 +23,7 @@ use rustc_serialize::Encodable; pub struct IsolatedEncoder<'a, 'b: 'a, 'tcx: 'b> { pub tcx: TyCtxt<'b, 'tcx, 'tcx>, ecx: &'a mut EncodeContext<'b, 'tcx>, - hcx: Option<(StableHashingContext<'b, 'tcx>, StableHasher)>, + hcx: Option<(StableHashingContext<'b, 'tcx, 'tcx>, StableHasher)>, } impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> { @@ -61,7 +61,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> { } pub fn lazy(&mut self, value: &T) -> Lazy - where T: Encodable + HashStable> + where T: Encodable + HashStable> { if let Some((ref mut hcx, ref mut hasher)) = self.hcx { value.hash_stable(hcx, hasher); @@ -72,7 +72,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> { pub fn lazy_seq(&mut self, iter: I) -> LazySeq where I: IntoIterator, - T: Encodable + HashStable> + T: Encodable + HashStable> { if let Some((ref mut hcx, ref mut hasher)) = self.hcx { let iter = iter.into_iter(); @@ -111,7 +111,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> { pub fn lazy_seq_ref<'x, I, T>(&mut self, iter: I) -> LazySeq where I: IntoIterator, - T: 'x + Encodable + HashStable> + T: 'x + Encodable + HashStable> { if let Some((ref mut hcx, ref mut hasher)) = self.hcx { let iter = iter.into_iter(); @@ -149,7 +149,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> { } pub fn lazy_seq_from_slice(&mut self, slice: &[T]) -> LazySeq - where T: Encodable + HashStable> + where T: Encodable + HashStable> { if let Some((ref mut hcx, ref mut hasher)) = self.hcx { slice.hash_stable(hcx, hasher); @@ -159,7 +159,7 @@ impl<'a, 'b: 'a, 'tcx: 'b> IsolatedEncoder<'a, 'b, 'tcx> { } pub fn lazy_seq_ref_from_slice(&mut self, slice: &[&T]) -> LazySeq - where T: Encodable + HashStable> + where T: Encodable + HashStable> { if let Some((ref mut hcx, ref mut hasher)) = self.hcx { slice.hash_stable(hcx, hasher); diff --git a/src/librustc_metadata/schema.rs b/src/librustc_metadata/schema.rs index 2ffe7cc02aa..9180f9100ad 100644 --- a/src/librustc_metadata/schema.rs +++ b/src/librustc_metadata/schema.rs @@ -221,11 +221,11 @@ impl Tracked { } } -impl<'a, 'tcx, T> HashStable> for Tracked - where T: HashStable> +impl<'a, 'gcx, 'tcx, T> HashStable> for Tracked + where T: HashStable> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let Tracked { ref state @@ -277,9 +277,9 @@ pub struct TraitImpls { pub impls: LazySeq, } -impl<'a, 'tcx> HashStable> for TraitImpls { +impl<'a, 'gcx, 'tcx> HashStable> for TraitImpls { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { let TraitImpls { trait_id: (krate, def_index), @@ -359,9 +359,9 @@ pub enum EntryKind<'tcx> { AssociatedConst(AssociatedContainer, u8), } -impl<'a, 'tcx> HashStable> for EntryKind<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> for EntryKind<'tcx> { fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'tcx>, + hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); match *self {