Skip to content

Commit 180b859

Browse files
Add comment to explain what is the top parameter
1 parent f20d586 commit 180b859

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/librustdoc/html/render.rs

+8
Original file line numberDiff line numberDiff line change
@@ -3789,6 +3789,14 @@ const ATTRIBUTE_WHITELIST: &'static [&'static str] = &[
37893789
"non_exhaustive"
37903790
];
37913791

3792+
// The `top` parameter is used when generating the item declaration to ensure it doesn't have a
3793+
// left padding. For example:
3794+
//
3795+
// #[foo] <----- "top" attribute
3796+
// struct Foo {
3797+
// #[bar] <---- not "top" attribute
3798+
// bar: usize,
3799+
// }
37923800
fn render_attributes(w: &mut dyn fmt::Write, it: &clean::Item, top: bool) -> fmt::Result {
37933801
let mut attrs = String::new();
37943802

0 commit comments

Comments
 (0)