Skip to content

Commit 474ad2e

Browse files
committed
rustdoc: Fix native mod breakage
1 parent 4bbe33c commit 474ad2e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/rustdoc/markdown_pass.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ fn write_nmod(ctxt: ctxt, doc: doc::nmoddoc) {
420420
write_common(ctxt, doc.desc(), doc.sections());
421421

422422
for fndoc in doc.fns {
423+
write_item_header(ctxt, doc::fntag(fndoc));
423424
write_fn(ctxt, fndoc);
424425
}
425426
}
@@ -437,6 +438,12 @@ fn should_write_native_fns() {
437438
assert str::contains(markdown, "test");
438439
}
439440

441+
#[test]
442+
fn should_write_native_fn_headers() {
443+
let markdown = test::render("native mod a { #[doc = \"test\"] fn a(); }");
444+
assert str::contains(markdown, "## Function `a`");
445+
}
446+
440447
fn write_fn(
441448
ctxt: ctxt,
442449
doc: doc::fndoc

0 commit comments

Comments
 (0)