1
1
use crate :: ich;
2
2
3
3
use rustc_ast as ast;
4
- use rustc_data_structures:: sorted_map:: SortedMap ;
5
4
use rustc_data_structures:: stable_hasher:: { HashStable , HashingControls , StableHasher } ;
6
5
use rustc_data_structures:: sync:: Lrc ;
7
- use rustc_hir as hir;
8
6
use rustc_hir:: def_id:: { DefId , LocalDefId } ;
9
7
use rustc_hir:: definitions:: DefPathHash ;
10
8
use rustc_session:: cstore:: Untracked ;
@@ -23,7 +21,7 @@ pub struct StableHashingContext<'a> {
23
21
// The value of `-Z incremental-ignore-spans`.
24
22
// This field should only be used by `unstable_opts_incremental_ignore_span`
25
23
incremental_ignore_spans : bool ,
26
- pub ( super ) body_resolver : BodyResolver < ' a > ,
24
+ pub ( super ) body_resolver : BodyResolver ,
27
25
// Very often, we are hashing something that does not need the
28
26
// `CachingSourceMapView`, so we initialize it lazily.
29
27
raw_source_map : & ' a SourceMap ,
@@ -35,13 +33,9 @@ pub struct StableHashingContext<'a> {
35
33
/// We could also just store a plain reference to the `hir::Crate` but we want
36
34
/// to avoid that the crate is used to get untracked access to all of the HIR.
37
35
#[ derive( Clone , Copy ) ]
38
- pub ( super ) enum BodyResolver < ' tcx > {
36
+ pub ( super ) enum BodyResolver {
39
37
Forbidden ,
40
38
Ignore ,
41
- Traverse {
42
- owner : hir:: OwnerId ,
43
- bodies : & ' tcx SortedMap < hir:: ItemLocalId , & ' tcx hir:: Body < ' tcx > > ,
44
- } ,
45
39
}
46
40
47
41
impl < ' a > StableHashingContext < ' a > {
@@ -64,19 +58,6 @@ impl<'a> StableHashingContext<'a> {
64
58
f ( & mut StableHashingContext { body_resolver : BodyResolver :: Ignore , ..self . clone ( ) } ) ;
65
59
}
66
60
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
-
80
61
#[ inline]
81
62
pub fn while_hashing_spans < F : FnOnce ( & mut Self ) > ( & mut self , hash_spans : bool , f : F ) {
82
63
let prev_hash_spans = self . hashing_controls . hash_spans ;
0 commit comments