From 2d38c53767dd9a4e74b347f663eb7f41dea9232c Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Wed, 29 Sep 2021 19:47:55 +0200 Subject: [PATCH] Remove StableHashProvider. --- compiler/rustc_middle/src/ich/hcx.rs | 30 ---------------------------- compiler/rustc_middle/src/ich/mod.rs | 2 +- 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/compiler/rustc_middle/src/ich/hcx.rs b/compiler/rustc_middle/src/ich/hcx.rs index 029b4aed3ee..98dcd62f795 100644 --- a/compiler/rustc_middle/src/ich/hcx.rs +++ b/compiler/rustc_middle/src/ich/hcx.rs @@ -1,5 +1,4 @@ use crate::ich; -use crate::ty::TyCtxt; use rustc_ast as ast; use rustc_data_structures::fx::FxHashSet; 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> for ast::NodeId { fn hash_stable(&self, _: &mut StableHashingContext<'a>, _: &mut StableHasher) { panic!("Node IDs should not appear in incremental state"); diff --git a/compiler/rustc_middle/src/ich/mod.rs b/compiler/rustc_middle/src/ich/mod.rs index e8e5c4a2669..c91b6a8540b 100644 --- a/compiler/rustc_middle/src/ich/mod.rs +++ b/compiler/rustc_middle/src/ich/mod.rs @@ -1,6 +1,6 @@ //! ICH - Incremental Compilation Hash -pub use self::hcx::{NodeIdHashingMode, StableHashingContext, StableHashingContextProvider}; +pub use self::hcx::{NodeIdHashingMode, StableHashingContext}; use rustc_span::symbol::{sym, Symbol}; mod hcx;