11use crate :: ich;
22
33use rustc_ast as ast;
4- use rustc_data_structures:: sorted_map:: SortedMap ;
54use rustc_data_structures:: stable_hasher:: { HashStable , HashingControls , StableHasher } ;
65use rustc_data_structures:: sync:: Lrc ;
7- use rustc_hir as hir;
86use rustc_hir:: def_id:: { DefId , LocalDefId } ;
97use rustc_hir:: definitions:: DefPathHash ;
108use rustc_session:: cstore:: Untracked ;
@@ -23,7 +21,7 @@ pub struct StableHashingContext<'a> {
2321 // The value of `-Z incremental-ignore-spans`.
2422 // This field should only be used by `unstable_opts_incremental_ignore_span`
2523 incremental_ignore_spans : bool ,
26- pub ( super ) body_resolver : BodyResolver < ' a > ,
24+ pub ( super ) body_resolver : BodyResolver ,
2725 // Very often, we are hashing something that does not need the
2826 // `CachingSourceMapView`, so we initialize it lazily.
2927 raw_source_map : & ' a SourceMap ,
@@ -35,13 +33,9 @@ pub struct StableHashingContext<'a> {
3533/// We could also just store a plain reference to the `hir::Crate` but we want
3634/// to avoid that the crate is used to get untracked access to all of the HIR.
3735#[ derive( Clone , Copy ) ]
38- pub ( super ) enum BodyResolver < ' tcx > {
36+ pub ( super ) enum BodyResolver {
3937 Forbidden ,
4038 Ignore ,
41- Traverse {
42- owner : hir:: OwnerId ,
43- bodies : & ' tcx SortedMap < hir:: ItemLocalId , & ' tcx hir:: Body < ' tcx > > ,
44- } ,
4539}
4640
4741impl < ' a > StableHashingContext < ' a > {
@@ -64,19 +58,6 @@ impl<'a> StableHashingContext<'a> {
6458 f ( & mut StableHashingContext { body_resolver : BodyResolver :: Ignore , ..self . clone ( ) } ) ;
6559 }
6660
67- #[ inline]
68- pub fn with_hir_bodies (
69- & mut self ,
70- owner : hir:: OwnerId ,
71- bodies : & SortedMap < hir:: ItemLocalId , & hir:: Body < ' _ > > ,
72- f : impl FnOnce ( & mut StableHashingContext < ' _ > ) ,
73- ) {
74- f ( & mut StableHashingContext {
75- body_resolver : BodyResolver :: Traverse { owner, bodies } ,
76- ..self . clone ( )
77- } ) ;
78- }
79-
8061 #[ inline]
8162 pub fn while_hashing_spans < F : FnOnce ( & mut Self ) > ( & mut self , hash_spans : bool , f : F ) {
8263 let prev_hash_spans = self . hashing_controls . hash_spans ;
0 commit comments