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