diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-05-09 17:36:32 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-05-25 15:08:23 +0200 |
| commit | 4194745687ead479898587b85f1388635b3422e2 (patch) | |
| tree | 08dd688b51d857844998159097188dce37cdac76 /src/librustdoc/html/render/mod.rs | |
| parent | 560aec13ba62c1a8fd7b2f9fbeada61096809613 (diff) | |
| download | rust-4194745687ead479898587b85f1388635b3422e2.tar.gz rust-4194745687ead479898587b85f1388635b3422e2.zip | |
Split `Item::attributes` method into three
Diffstat (limited to 'src/librustdoc/html/render/mod.rs')
| -rw-r--r-- | src/librustdoc/html/render/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 06cb9269cc8..6b4fd3cd834 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -1194,7 +1194,7 @@ fn render_assoc_item( // a whitespace prefix and newline. fn render_attributes_in_pre(it: &clean::Item, prefix: &str, cx: &Context<'_>) -> impl fmt::Display { fmt::from_fn(move |f| { - for a in it.attributes(cx.tcx(), cx.cache(), false) { + for a in it.attributes_and_repr(cx.tcx(), cx.cache(), false) { writeln!(f, "{prefix}{a}")?; } Ok(()) @@ -1204,7 +1204,7 @@ fn render_attributes_in_pre(it: &clean::Item, prefix: &str, cx: &Context<'_>) -> // When an attribute is rendered inside a <code> tag, it is formatted using // a div to produce a newline after it. fn render_attributes_in_code(w: &mut impl fmt::Write, it: &clean::Item, cx: &Context<'_>) { - for attr in it.attributes(cx.tcx(), cx.cache(), false) { + for attr in it.attributes_and_repr(cx.tcx(), cx.cache(), false) { write!(w, "<div class=\"code-attribute\">{attr}</div>").unwrap(); } } |
