10
10
//!
11
11
//! SpanUtils is used to manipulate spans. In particular, to extract sub-spans
12
12
//! from spans (e.g., the span for `bar` from the above example path).
13
- //! DumpVisitor walks the AST and processes it, and JsonDumper is used for
13
+ //! DumpVisitor walks the AST and processes it, and Dumper is used for
14
14
//! recording the output.
15
15
16
16
use rustc:: hir:: def:: { Res , DefKind as HirDefKind } ;
@@ -38,7 +38,7 @@ use syntax_pos::*;
38
38
39
39
use crate :: { escape, generated_code, id_from_def_id, id_from_node_id, lower_attributes,
40
40
PathCollector , SaveContext } ;
41
- use crate :: json_dumper :: { Access , DumpOutput , JsonDumper } ;
41
+ use crate :: dumper :: { Access , Dumper } ;
42
42
use crate :: span_utils:: SpanUtils ;
43
43
use crate :: sig;
44
44
@@ -75,10 +75,10 @@ macro_rules! access_from_vis {
75
75
} ;
76
76
}
77
77
78
- pub struct DumpVisitor < ' l , ' tcx , ' ll , O : DumpOutput > {
78
+ pub struct DumpVisitor < ' l , ' tcx , ' ll > {
79
79
save_ctxt : SaveContext < ' l , ' tcx > ,
80
80
tcx : TyCtxt < ' tcx > ,
81
- dumper : & ' ll mut JsonDumper < O > ,
81
+ dumper : & ' ll mut Dumper ,
82
82
83
83
span : SpanUtils < ' l > ,
84
84
@@ -92,11 +92,11 @@ pub struct DumpVisitor<'l, 'tcx, 'll, O: DumpOutput> {
92
92
// macro_calls: FxHashSet<Span>,
93
93
}
94
94
95
- impl < ' l , ' tcx , ' ll , O : DumpOutput + ' ll > DumpVisitor < ' l , ' tcx , ' ll , O > {
95
+ impl < ' l , ' tcx , ' ll > DumpVisitor < ' l , ' tcx , ' ll > {
96
96
pub fn new (
97
97
save_ctxt : SaveContext < ' l , ' tcx > ,
98
- dumper : & ' ll mut JsonDumper < O > ,
99
- ) -> DumpVisitor < ' l , ' tcx , ' ll , O > {
98
+ dumper : & ' ll mut Dumper ,
99
+ ) -> DumpVisitor < ' l , ' tcx , ' ll > {
100
100
let span_utils = SpanUtils :: new ( & save_ctxt. tcx . sess ) ;
101
101
DumpVisitor {
102
102
tcx : save_ctxt. tcx ,
@@ -111,7 +111,7 @@ impl<'l, 'tcx, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
111
111
112
112
fn nest_scope < F > ( & mut self , scope_id : NodeId , f : F )
113
113
where
114
- F : FnOnce ( & mut DumpVisitor < ' l , ' tcx , ' ll , O > ) ,
114
+ F : FnOnce ( & mut DumpVisitor < ' l , ' tcx , ' ll > ) ,
115
115
{
116
116
let parent_scope = self . cur_scope ;
117
117
self . cur_scope = scope_id;
@@ -121,7 +121,7 @@ impl<'l, 'tcx, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
121
121
122
122
fn nest_tables < F > ( & mut self , item_id : NodeId , f : F )
123
123
where
124
- F : FnOnce ( & mut DumpVisitor < ' l , ' tcx , ' ll , O > ) ,
124
+ F : FnOnce ( & mut DumpVisitor < ' l , ' tcx , ' ll > ) ,
125
125
{
126
126
let item_def_id = self . tcx . hir ( ) . local_def_id_from_node_id ( item_id) ;
127
127
if self . tcx . has_typeck_tables ( item_def_id) {
@@ -1311,7 +1311,7 @@ impl<'l, 'tcx, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
1311
1311
}
1312
1312
}
1313
1313
1314
- impl < ' l , ' tcx , ' ll , O : DumpOutput + ' ll > Visitor < ' l > for DumpVisitor < ' l , ' tcx , ' ll , O > {
1314
+ impl < ' l , ' tcx , ' ll > Visitor < ' l > for DumpVisitor < ' l , ' tcx , ' ll > {
1315
1315
fn visit_mod ( & mut self , m : & ' l ast:: Mod , span : Span , attrs : & [ ast:: Attribute ] , id : NodeId ) {
1316
1316
// Since we handle explicit modules ourselves in visit_item, this should
1317
1317
// only get called for the root module of a crate.
0 commit comments