@@ -63,6 +63,8 @@ pub enum Data {
63
63
VariableRefData ( VariableRefData ) ,
64
64
/// Data for a reference to a type or trait.
65
65
TypeRefData ( TypeRefData ) ,
66
+ /// Data for a reference to a module.
67
+ ModRefData ( ModRefData ) ,
66
68
/// Data about a function call.
67
69
FunctionCallData ( FunctionCallData ) ,
68
70
/// Data about a method call.
@@ -143,6 +145,14 @@ pub struct TypeRefData {
143
145
pub ref_id : DefId ,
144
146
}
145
147
148
+ /// Data for a reference to a module.
149
+ #[ derive( Debug ) ]
150
+ pub struct ModRefData {
151
+ pub span : Span ,
152
+ pub scope : NodeId ,
153
+ pub ref_id : DefId ,
154
+ }
155
+
146
156
/// Data about a function call.
147
157
#[ derive( Debug ) ]
148
158
pub struct FunctionCallData {
@@ -585,6 +595,13 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
585
595
scope : self . enclosing_scope ( id) ,
586
596
} )
587
597
}
598
+ def:: DefMod ( def_id) => {
599
+ Data :: ModRefData ( ModRefData {
600
+ ref_id : def_id,
601
+ span : sub_span. unwrap ( ) ,
602
+ scope : self . enclosing_scope ( id) ,
603
+ } )
604
+ }
588
605
_ => self . tcx . sess . span_bug ( path. span ,
589
606
& format ! ( "Unexpected def kind while looking \
590
607
up path in `{}`: `{:?}`",
0 commit comments