@@ -85,7 +85,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
85
85
None ) ;
86
86
// attach the crate's exported macros to the top-level module:
87
87
let macro_exports: Vec < _ > =
88
- krate. exported_macros . iter ( ) . map ( |def| self . visit_macro ( def) ) . collect ( ) ;
88
+ krate. exported_macros . iter ( ) . map ( |def| self . visit_local_macro ( def) ) . collect ( ) ;
89
89
self . module . macros . extend ( macro_exports) ;
90
90
self . module . is_crate = true ;
91
91
}
@@ -210,7 +210,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
210
210
// FIXME(jseyfried) merge with `self.visit_macro()`
211
211
let matchers = def. body . chunks ( 4 ) . map ( |arm| arm[ 0 ] . get_span ( ) ) . collect ( ) ;
212
212
om. macros . push ( Macro {
213
- id : def . id ,
213
+ def_id : def_id ,
214
214
attrs : def. attrs . clone ( ) . into ( ) ,
215
215
name : def. ident . name ,
216
216
whence : def. span ,
@@ -513,12 +513,12 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
513
513
}
514
514
515
515
// convert each exported_macro into a doc item
516
- fn visit_macro ( & self , def : & hir:: MacroDef ) -> Macro {
516
+ fn visit_local_macro ( & self , def : & hir:: MacroDef ) -> Macro {
517
517
// Extract the spans of all matchers. They represent the "interface" of the macro.
518
518
let matchers = def. body . chunks ( 4 ) . map ( |arm| arm[ 0 ] . get_span ( ) ) . collect ( ) ;
519
519
520
520
Macro {
521
- id : def. id ,
521
+ def_id : self . cx . tcx . map . local_def_id ( def. id ) ,
522
522
attrs : def. attrs . clone ( ) ,
523
523
name : def. name ,
524
524
whence : def. span ,
0 commit comments