Skip to content

Commit

Permalink
Add comment to explain what is the top parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed May 14, 2019
1 parent f20d586 commit 180b859
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/librustdoc/html/render.rs
Expand Up @@ -3789,6 +3789,14 @@ const ATTRIBUTE_WHITELIST: &'static [&'static str] = &[
"non_exhaustive"
];

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

Expand Down

0 comments on commit 180b859

Please sign in to comment.