@@ -75,10 +75,10 @@ macro_rules! access_from_vis {
75
75
} ;
76
76
}
77
77
78
- pub struct DumpVisitor < ' l , ' tcx , ' ll > {
78
+ pub struct DumpVisitor < ' l , ' tcx > {
79
79
save_ctxt : SaveContext < ' l , ' tcx > ,
80
80
tcx : TyCtxt < ' tcx > ,
81
- dumper : & ' ll mut Dumper ,
81
+ dumper : Dumper ,
82
82
83
83
span : SpanUtils < ' l > ,
84
84
@@ -90,12 +90,12 @@ pub struct DumpVisitor<'l, 'tcx, 'll> {
90
90
// macro_calls: FxHashSet<Span>,
91
91
}
92
92
93
- impl < ' l , ' tcx , ' ll > DumpVisitor < ' l , ' tcx , ' ll > {
93
+ impl < ' l , ' tcx > DumpVisitor < ' l , ' tcx > {
94
94
pub fn new (
95
95
save_ctxt : SaveContext < ' l , ' tcx > ,
96
- dumper : & ' ll mut Dumper ,
97
- ) -> DumpVisitor < ' l , ' tcx , ' ll > {
96
+ ) -> DumpVisitor < ' l , ' tcx > {
98
97
let span_utils = SpanUtils :: new ( & save_ctxt. tcx . sess ) ;
98
+ let dumper = Dumper :: new ( save_ctxt. config . clone ( ) ) ;
99
99
DumpVisitor {
100
100
tcx : save_ctxt. tcx ,
101
101
save_ctxt,
@@ -106,9 +106,13 @@ impl<'l, 'tcx, 'll> DumpVisitor<'l, 'tcx, 'll> {
106
106
}
107
107
}
108
108
109
+ pub fn into_analysis ( self ) -> rls_data:: Analysis {
110
+ self . dumper . into_analysis ( )
111
+ }
112
+
109
113
fn nest_tables < F > ( & mut self , item_id : NodeId , f : F )
110
114
where
111
- F : FnOnce ( & mut DumpVisitor < ' l , ' tcx , ' ll > ) ,
115
+ F : FnOnce ( & mut Self ) ,
112
116
{
113
117
let item_def_id = self . tcx . hir ( ) . local_def_id_from_node_id ( item_id) ;
114
118
if self . tcx . has_typeck_tables ( item_def_id) {
@@ -1298,7 +1302,7 @@ impl<'l, 'tcx, 'll> DumpVisitor<'l, 'tcx, 'll> {
1298
1302
}
1299
1303
}
1300
1304
1301
- impl < ' l , ' tcx , ' ll > Visitor < ' l > for DumpVisitor < ' l , ' tcx , ' ll > {
1305
+ impl < ' l , ' tcx > Visitor < ' l > for DumpVisitor < ' l , ' tcx > {
1302
1306
fn visit_mod ( & mut self , m : & ' l ast:: Mod , span : Span , attrs : & [ ast:: Attribute ] , id : NodeId ) {
1303
1307
// Since we handle explicit modules ourselves in visit_item, this should
1304
1308
// only get called for the root module of a crate.
0 commit comments