diff --git a/src/librustc/ich/impls_mir.rs b/src/librustc/ich/impls_mir.rs index c20864183f47a0cf774efa72fa78d875f142a83f..faf579186e5fcd7d9d9ea9f3c251efb578a54b4f 100644 --- a/src/librustc/ich/impls_mir.rs +++ b/src/librustc/ich/impls_mir.rs @@ -33,7 +33,7 @@ impl_stable_hash_for!(struct mir::BasicBlockData<'tcx> { statements, terminator, is_cleanup }); impl<'a, 'gcx, 'tcx> HashStable> -for mir::Terminator<'tcx> { +for mir::Terminator<'gcx> { #[inline] fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, @@ -125,7 +125,7 @@ fn hash_stable(&self, } impl<'a, 'gcx, 'tcx> HashStable> -for mir::TerminatorKind<'tcx> { +for mir::TerminatorKind<'gcx> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { @@ -186,7 +186,7 @@ fn hash_stable(&self, } impl<'a, 'gcx, 'tcx> HashStable> -for mir::AssertMessage<'tcx> { +for mir::AssertMessage<'gcx> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { @@ -207,7 +207,7 @@ fn hash_stable(&self, impl_stable_hash_for!(struct mir::Statement<'tcx> { source_info, kind }); impl<'a, 'gcx, 'tcx> HashStable> -for mir::StatementKind<'tcx> { +for mir::StatementKind<'gcx> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { @@ -244,7 +244,7 @@ fn hash_stable(&self, } impl<'a, 'gcx, 'tcx, T> HashStable> - for mir::ValidationOperand<'tcx, T> + for mir::ValidationOperand<'gcx, T> where T: HashStable> { fn hash_stable(&self, @@ -260,7 +260,7 @@ fn hash_stable(&self, impl_stable_hash_for!(enum mir::ValidationOp { Acquire, Release, Suspend(extent) }); -impl<'a, 'gcx, 'tcx> HashStable> for mir::Lvalue<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> for mir::Lvalue<'gcx> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { @@ -280,7 +280,7 @@ fn hash_stable(&self, } impl<'a, 'gcx, 'tcx, B, V, T> HashStable> -for mir::Projection<'tcx, B, V, T> +for mir::Projection<'gcx, B, V, T> where B: HashStable>, V: HashStable>, T: HashStable> @@ -299,7 +299,7 @@ fn hash_stable(&self, } impl<'a, 'gcx, 'tcx, V, T> HashStable> -for mir::ProjectionElem<'tcx, V, T> +for mir::ProjectionElem<'gcx, V, T> where V: HashStable>, T: HashStable> { @@ -335,7 +335,7 @@ fn hash_stable(&self, impl_stable_hash_for!(struct mir::VisibilityScopeData { span, parent_scope }); -impl<'a, 'gcx, 'tcx> HashStable> for mir::Operand<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> for mir::Operand<'gcx> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { @@ -352,7 +352,7 @@ fn hash_stable(&self, } } -impl<'a, 'gcx, 'tcx> HashStable> for mir::Rvalue<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> for mir::Rvalue<'gcx> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { @@ -413,7 +413,7 @@ fn hash_stable(&self, }); impl<'a, 'gcx, 'tcx> HashStable> -for mir::AggregateKind<'tcx> { +for mir::AggregateKind<'gcx> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { @@ -469,7 +469,7 @@ fn hash_stable(&self, impl_stable_hash_for!(struct mir::Constant<'tcx> { span, ty, literal }); -impl<'a, 'gcx, 'tcx> HashStable> for mir::Literal<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> for mir::Literal<'gcx> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { diff --git a/src/librustc/ich/impls_ty.rs b/src/librustc/ich/impls_ty.rs index 5269ec90def5c015c3117dd2ef42d982b413cdb9..ec3f3c113e8338c2656373b92b27441228a0f006 100644 --- a/src/librustc/ich/impls_ty.rs +++ b/src/librustc/ich/impls_ty.rs @@ -20,7 +20,7 @@ use ty; impl<'a, 'gcx, 'tcx, T> HashStable> -for &'tcx ty::Slice +for &'gcx ty::Slice where T: HashStable> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, @@ -30,7 +30,7 @@ fn hash_stable(&self, } impl<'a, 'gcx, 'tcx> HashStable> -for ty::subst::Kind<'tcx> { +for ty::subst::Kind<'gcx> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { @@ -55,6 +55,11 @@ fn hash_stable(&self, db.depth.hash_stable(hcx, hasher); i.hash_stable(hcx, hasher); } + ty::ReLateBound(db, ty::BrNamed(def_id, name)) => { + db.depth.hash_stable(hcx, hasher); + def_id.hash_stable(hcx, hasher); + name.hash_stable(hcx, hasher); + } ty::ReEarlyBound(ty::EarlyBoundRegion { def_id, index, name }) => { def_id.hash_stable(hcx, hasher); index.hash_stable(hcx, hasher); @@ -76,7 +81,7 @@ fn hash_stable(&self, } impl<'a, 'gcx, 'tcx> HashStable> -for ty::adjustment::AutoBorrow<'tcx> { +for ty::adjustment::AutoBorrow<'gcx> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { @@ -94,7 +99,7 @@ fn hash_stable(&self, } impl<'a, 'gcx, 'tcx> HashStable> -for ty::adjustment::Adjust<'tcx> { +for ty::adjustment::Adjust<'gcx> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { @@ -128,7 +133,7 @@ fn hash_stable(&self, }); impl<'a, 'gcx, 'tcx> HashStable> -for ty::UpvarCapture<'tcx> { +for ty::UpvarCapture<'gcx> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { @@ -150,12 +155,13 @@ fn hash_stable(&self, }); impl<'a, 'gcx, 'tcx, T> HashStable> for ty::Binder - where T: HashStable> + ty::fold::TypeFoldable<'tcx> + where T: HashStable> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { - hcx.tcx().anonymize_late_bound_regions(self).0.hash_stable(hcx, hasher); + let ty::Binder(ref inner) = *self; + inner.hash_stable(hcx, hasher); } } @@ -190,7 +196,7 @@ fn hash_stable(&self, impl_stable_hash_for!(struct ty::ProjectionTy<'tcx> { substs, item_def_id }); -impl<'a, 'gcx, 'tcx> HashStable> for ty::Predicate<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> for ty::Predicate<'gcx> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { @@ -256,7 +262,7 @@ fn hash_stable(&self, }); impl<'a, 'gcx, 'tcx> HashStable> -for ::middle::const_val::ConstVal<'tcx> { +for ::middle::const_val::ConstVal<'gcx> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { @@ -483,7 +489,7 @@ fn hash_stable(&self, }); impl<'a, 'gcx, 'tcx> HashStable> -for ty::TypeVariants<'tcx> +for ty::TypeVariants<'gcx> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, @@ -574,7 +580,7 @@ fn hash_stable(&self, }); impl<'a, 'gcx, 'tcx> HashStable> -for ty::ExistentialPredicate<'tcx> +for ty::ExistentialPredicate<'gcx> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, @@ -607,7 +613,7 @@ fn hash_stable(&self, impl<'a, 'gcx, 'tcx> HashStable> -for ty::TypeckTables<'tcx> { +for ty::TypeckTables<'gcx> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { @@ -689,7 +695,7 @@ fn hash_stable(&self, substs }); -impl<'a, 'gcx, 'tcx> HashStable> for ty::InstanceDef<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> for ty::InstanceDef<'gcx> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) { diff --git a/src/librustc/macros.rs b/src/librustc/macros.rs index f814f941b06f1aed2dd35a0a18b8c3214e8c3e28..f3d66b49de5a89000c00ec4597a4e68bebd9313b 100644 --- a/src/librustc/macros.rs +++ b/src/librustc/macros.rs @@ -73,10 +73,10 @@ pub fn from_u32(u: u32) -> Option<$name> { #[macro_export] macro_rules! impl_stable_hash_for { (enum $enum_name:path { $( $variant:ident $( ( $($arg:ident),* ) )* ),* }) => { - impl<'a, 'gcx, 'tcx> ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a, 'gcx, 'tcx>> for $enum_name { + impl<'a, 'tcx, 'lcx> ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a, 'tcx, 'lcx>> for $enum_name { #[inline] fn hash_stable(&self, - __ctx: &mut $crate::ich::StableHashingContext<'a, 'gcx, 'tcx>, + __ctx: &mut $crate::ich::StableHashingContext<'a, 'tcx, 'lcx>, __hasher: &mut ::rustc_data_structures::stable_hasher::StableHasher) { use $enum_name::*; ::std::mem::discriminant(self).hash_stable(__ctx, __hasher); @@ -92,10 +92,10 @@ fn hash_stable(&s } }; (struct $struct_name:path { $($field:ident),* }) => { - impl<'a, 'gcx, 'tcx> ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a, 'gcx, 'tcx>> for $struct_name { + impl<'a, 'tcx, 'lcx> ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a, 'tcx, 'lcx>> for $struct_name { #[inline] fn hash_stable(&self, - __ctx: &mut $crate::ich::StableHashingContext<'a, 'gcx, 'tcx>, + __ctx: &mut $crate::ich::StableHashingContext<'a, 'tcx, 'lcx>, __hasher: &mut ::rustc_data_structures::stable_hasher::StableHasher) { let $struct_name { $(ref $field),* @@ -106,10 +106,10 @@ fn hash_stable(&s } }; (tuple_struct $struct_name:path { $($field:ident),* }) => { - impl<'a, 'gcx, 'tcx> ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a, 'gcx, 'tcx>> for $struct_name { + impl<'a, 'tcx, 'lcx> ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a, 'tcx, 'lcx>> for $struct_name { #[inline] fn hash_stable(&self, - __ctx: &mut $crate::ich::StableHashingContext<'a, 'gcx, 'tcx>, + __ctx: &mut $crate::ich::StableHashingContext<'a, 'tcx, 'lcx>, __hasher: &mut ::rustc_data_structures::stable_hasher::StableHasher) { let $struct_name ( $(ref $field),* @@ -125,11 +125,11 @@ fn hash_stable(&s macro_rules! impl_stable_hash_for_spanned { ($T:path) => ( - impl<'a, 'gcx, 'tcx> HashStable> for ::syntax::codemap::Spanned<$T> + impl<'a, 'tcx, 'lcx> HashStable> for ::syntax::codemap::Spanned<$T> { #[inline] fn hash_stable(&self, - hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, + hcx: &mut StableHashingContext<'a, 'tcx, 'lcx>, hasher: &mut StableHasher) { self.node.hash_stable(hcx, hasher); self.span.hash_stable(hcx, hasher); diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index eef0bcc375358050d86e52cd8ada0e7905695996..93687d6299a9a72e6fad013230d2da434439c277 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -497,7 +497,7 @@ pub fn is_suggestable(&self) -> bool { } } -impl<'a, 'gcx, 'tcx> HashStable> for ty::TyS<'tcx> { +impl<'a, 'gcx, 'tcx> HashStable> for ty::TyS<'gcx> { fn hash_stable(&self, hcx: &mut StableHashingContext<'a, 'gcx, 'tcx>, hasher: &mut StableHasher) {