@@ -100,6 +100,8 @@ impl<'a> Resolver<'a> {
100
100
}
101
101
102
102
fn build_reduced_graph_for_use_tree ( & mut self ,
103
+ root_use_tree : & ast:: UseTree ,
104
+ root_id : NodeId ,
103
105
use_tree : & ast:: UseTree ,
104
106
id : NodeId ,
105
107
vis : ty:: Visibility ,
@@ -182,7 +184,14 @@ impl<'a> Resolver<'a> {
182
184
type_ns_only,
183
185
} ;
184
186
self . add_import_directive (
185
- module_path, subclass, use_tree. span , id, vis, expansion,
187
+ module_path,
188
+ subclass,
189
+ use_tree. span ,
190
+ id,
191
+ root_use_tree. span ,
192
+ root_id,
193
+ vis,
194
+ expansion,
186
195
) ;
187
196
}
188
197
ast:: UseTreeKind :: Glob => {
@@ -191,7 +200,14 @@ impl<'a> Resolver<'a> {
191
200
max_vis : Cell :: new ( ty:: Visibility :: Invisible ) ,
192
201
} ;
193
202
self . add_import_directive (
194
- module_path, subclass, use_tree. span , id, vis, expansion,
203
+ module_path,
204
+ subclass,
205
+ use_tree. span ,
206
+ id,
207
+ root_use_tree. span ,
208
+ root_id,
209
+ vis,
210
+ expansion,
195
211
) ;
196
212
}
197
213
ast:: UseTreeKind :: Nested ( ref items) => {
@@ -226,7 +242,7 @@ impl<'a> Resolver<'a> {
226
242
227
243
for & ( ref tree, id) in items {
228
244
self . build_reduced_graph_for_use_tree (
229
- tree, id, vis, & prefix, true , item, expansion
245
+ root_use_tree , root_id , tree, id, vis, & prefix, true , item, expansion
230
246
) ;
231
247
}
232
248
}
@@ -249,7 +265,7 @@ impl<'a> Resolver<'a> {
249
265
} ;
250
266
251
267
self . build_reduced_graph_for_use_tree (
252
- use_tree, item. id , vis, & prefix, false , item, expansion,
268
+ use_tree, item. id , use_tree , item . id , vis, & prefix, false , item, expansion,
253
269
) ;
254
270
}
255
271
@@ -266,10 +282,12 @@ impl<'a> Resolver<'a> {
266
282
let binding =
267
283
( module, ty:: Visibility :: Public , sp, expansion) . to_name_binding ( self . arenas ) ;
268
284
let directive = self . arenas . alloc_import_directive ( ImportDirective {
285
+ root_id : item. id ,
269
286
id : item. id ,
270
287
parent,
271
288
imported_module : Cell :: new ( Some ( module) ) ,
272
289
subclass : ImportDirectiveSubclass :: ExternCrate ( orig_name) ,
290
+ root_span : item. span ,
273
291
span : item. span ,
274
292
module_path : Vec :: new ( ) ,
275
293
vis : Cell :: new ( vis) ,
@@ -640,10 +658,12 @@ impl<'a> Resolver<'a> {
640
658
641
659
let ( graph_root, arenas) = ( self . graph_root , self . arenas ) ;
642
660
let macro_use_directive = |span| arenas. alloc_import_directive ( ImportDirective {
661
+ root_id : item. id ,
643
662
id : item. id ,
644
663
parent : graph_root,
645
664
imported_module : Cell :: new ( Some ( module) ) ,
646
665
subclass : ImportDirectiveSubclass :: MacroUse ,
666
+ root_span : span,
647
667
span,
648
668
module_path : Vec :: new ( ) ,
649
669
vis : Cell :: new ( ty:: Visibility :: Restricted ( DefId :: local ( CRATE_DEF_INDEX ) ) ) ,
0 commit comments