Skip to content

Commit 752112c

Browse files
committed
Pass --crate-type to rustdoc
This supports the corresponding rustc PR. To enable rustdoc to properly document macros, we mirror the '--crate-type' flag used by rustc. Currently, all crate types other than 'proc-macro' are ignored by rustdoc.
1 parent 651b1c5 commit 752112c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/cargo/core/compiler/compilation.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ impl<'cfg> Compilation<'cfg> {
140140
if target.edition() != Edition::Edition2015 {
141141
p.arg(format!("--edition={}", target.edition()));
142142
}
143+
for crate_type in target.rustc_crate_types() {
144+
p.arg("--crate-type").arg(crate_type);
145+
}
146+
143147
Ok(p)
144148
}
145149

0 commit comments

Comments
 (0)