add derive macros' helper attributes to doc output
This commit is contained in:
parent
869ebc4f95
commit
27429d9415
5 changed files with 34 additions and 1 deletions
|
@ -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>")?;
|
||||
}
|
||||
_ => {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue