1
Fork 0

add derive macros' helper attributes to doc output

This commit is contained in:
QuietMisdreavus 2018-09-26 11:29:41 -05:00
parent 869ebc4f95
commit 27429d9415
5 changed files with 34 additions and 1 deletions

View file

@ -4626,6 +4626,14 @@ fn item_proc_macro(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item, m: &c
MacroKind::Derive => {
write!(w, "<pre class='rust derive'>")?;
write!(w, "#[derive({})]", name)?;
if !m.helpers.is_empty() {
writeln!(w, "\n{{")?;
writeln!(w, " // Attributes available to this derive:")?;
for attr in &m.helpers {
writeln!(w, " #[{}]", attr)?;
}
write!(w, "}}")?;
}
write!(w, "</pre>")?;
}
_ => {}