Remove StableHashProvider.
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
use crate::ich;
|
use crate::ich;
|
||||||
use crate::ty::TyCtxt;
|
|
||||||
use rustc_ast as ast;
|
use rustc_ast as ast;
|
||||||
use rustc_data_structures::fx::FxHashSet;
|
use rustc_data_structures::fx::FxHashSet;
|
||||||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
||||||
@@ -178,35 +177,6 @@ impl<'a> StableHashingContext<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Something that can provide a stable hashing context.
|
|
||||||
pub trait StableHashingContextProvider<'a> {
|
|
||||||
fn get_stable_hashing_context(&self) -> StableHashingContext<'a>;
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a, 'b, T: StableHashingContextProvider<'a>> StableHashingContextProvider<'a> for &'b T {
|
|
||||||
fn get_stable_hashing_context(&self) -> StableHashingContext<'a> {
|
|
||||||
(**self).get_stable_hashing_context()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a, 'b, T: StableHashingContextProvider<'a>> StableHashingContextProvider<'a> for &'b mut T {
|
|
||||||
fn get_stable_hashing_context(&self) -> StableHashingContext<'a> {
|
|
||||||
(**self).get_stable_hashing_context()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl StableHashingContextProvider<'tcx> for TyCtxt<'tcx> {
|
|
||||||
fn get_stable_hashing_context(&self) -> StableHashingContext<'tcx> {
|
|
||||||
(*self).create_stable_hashing_context()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> StableHashingContextProvider<'a> for StableHashingContext<'a> {
|
|
||||||
fn get_stable_hashing_context(&self) -> StableHashingContext<'a> {
|
|
||||||
self.clone()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> HashStable<StableHashingContext<'a>> for ast::NodeId {
|
impl<'a> HashStable<StableHashingContext<'a>> for ast::NodeId {
|
||||||
fn hash_stable(&self, _: &mut StableHashingContext<'a>, _: &mut StableHasher) {
|
fn hash_stable(&self, _: &mut StableHashingContext<'a>, _: &mut StableHasher) {
|
||||||
panic!("Node IDs should not appear in incremental state");
|
panic!("Node IDs should not appear in incremental state");
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
//! ICH - Incremental Compilation Hash
|
//! ICH - Incremental Compilation Hash
|
||||||
|
|
||||||
pub use self::hcx::{NodeIdHashingMode, StableHashingContext, StableHashingContextProvider};
|
pub use self::hcx::{NodeIdHashingMode, StableHashingContext};
|
||||||
use rustc_span::symbol::{sym, Symbol};
|
use rustc_span::symbol::{sym, Symbol};
|
||||||
|
|
||||||
mod hcx;
|
mod hcx;
|
||||||
|
|||||||
Reference in New Issue
Block a user