@@ -75,10 +75,10 @@ macro_rules! access_from_vis {
7575 } ;
7676}
7777
78- pub struct DumpVisitor < ' l , ' tcx , ' ll > {
78+ pub struct DumpVisitor < ' l , ' tcx > {
7979 save_ctxt : SaveContext < ' l , ' tcx > ,
8080 tcx : TyCtxt < ' tcx > ,
81- dumper : & ' ll mut Dumper ,
81+ dumper : Dumper ,
8282
8383 span : SpanUtils < ' l > ,
8484
@@ -90,12 +90,12 @@ pub struct DumpVisitor<'l, 'tcx, 'll> {
9090 // macro_calls: FxHashSet<Span>,
9191}
9292
93- impl < ' l , ' tcx , ' ll > DumpVisitor < ' l , ' tcx , ' ll > {
93+ impl < ' l , ' tcx > DumpVisitor < ' l , ' tcx > {
9494 pub fn new (
9595 save_ctxt : SaveContext < ' l , ' tcx > ,
96- dumper : & ' ll mut Dumper ,
97- ) -> DumpVisitor < ' l , ' tcx , ' ll > {
96+ ) -> DumpVisitor < ' l , ' tcx > {
9897 let span_utils = SpanUtils :: new ( & save_ctxt. tcx . sess ) ;
98+ let dumper = Dumper :: new ( save_ctxt. config . clone ( ) ) ;
9999 DumpVisitor {
100100 tcx : save_ctxt. tcx ,
101101 save_ctxt,
@@ -106,9 +106,13 @@ impl<'l, 'tcx, 'll> DumpVisitor<'l, 'tcx, 'll> {
106106 }
107107 }
108108
109+ pub fn into_analysis ( self ) -> rls_data:: Analysis {
110+ self . dumper . into_analysis ( )
111+ }
112+
109113 fn nest_tables < F > ( & mut self , item_id : NodeId , f : F )
110114 where
111- F : FnOnce ( & mut DumpVisitor < ' l , ' tcx , ' ll > ) ,
115+ F : FnOnce ( & mut Self ) ,
112116 {
113117 let item_def_id = self . tcx . hir ( ) . local_def_id_from_node_id ( item_id) ;
114118 if self . tcx . has_typeck_tables ( item_def_id) {
@@ -1298,7 +1302,7 @@ impl<'l, 'tcx, 'll> DumpVisitor<'l, 'tcx, 'll> {
12981302 }
12991303}
13001304
1301- impl < ' l , ' tcx , ' ll > Visitor < ' l > for DumpVisitor < ' l , ' tcx , ' ll > {
1305+ impl < ' l , ' tcx > Visitor < ' l > for DumpVisitor < ' l , ' tcx > {
13021306 fn visit_mod ( & mut self , m : & ' l ast:: Mod , span : Span , attrs : & [ ast:: Attribute ] , id : NodeId ) {
13031307 // Since we handle explicit modules ourselves in visit_item, this should
13041308 // only get called for the root module of a crate.
0 commit comments