Skip to content

Commit a220321

Browse files
use the imported name when rendering an imported macro
1 parent 5e50950 commit a220321

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustdoc/clean/inline.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub fn try_inline(cx: &DocContext, def: Def, name: ast::Name, visited: &mut FxHa
104104
// separately
105105
Def::Macro(did, MacroKind::Bang) => {
106106
record_extern_fqn(cx, did, clean::TypeKind::Macro);
107-
clean::MacroItem(build_macro(cx, did))
107+
clean::MacroItem(build_macro(cx, did, name))
108108
}
109109
_ => return None,
110110
};
@@ -463,7 +463,7 @@ fn build_static(cx: &DocContext, did: DefId, mutable: bool) -> clean::Static {
463463
}
464464
}
465465

466-
fn build_macro(cx: &DocContext, did: DefId) -> clean::Macro {
466+
fn build_macro(cx: &DocContext, did: DefId, name: ast::Name) -> clean::Macro {
467467
let imported_from = cx.tcx.original_crate_name(did.krate);
468468
let def = match cx.cstore.load_macro_untracked(did, cx.sess()) {
469469
LoadedMacro::MacroDef(macro_def) => macro_def,
@@ -479,7 +479,7 @@ fn build_macro(cx: &DocContext, did: DefId) -> clean::Macro {
479479
};
480480

481481
let source = format!("macro_rules! {} {{\n{}}}",
482-
def.ident.name.clean(cx),
482+
name.clean(cx),
483483
matchers.iter().map(|span| {
484484
format!(" {} => {{ ... }};\n", span.to_src(cx))
485485
}).collect::<String>());

0 commit comments

Comments
 (0)