Skip to content

Commit 8d34065

Browse files
committed
Fix borrowing errors
1 parent cb28bbd commit 8d34065

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/librustdoc/html/render/print_item.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,6 +1609,15 @@ fn item_struct(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, s: &clean
16091609
Self { cx, it, s, should_render_fields }
16101610
}
16111611

1612+
fn render_attributes_in_code<'b>(
1613+
&'b self,
1614+
) -> impl fmt::Display + Captures<'a> + 'b + Captures<'cx> {
1615+
display_fn(move |f| {
1616+
let tcx = self.cx.borrow().tcx();
1617+
write!(f, "{}", render_attributes_in_code(self.it, tcx))
1618+
})
1619+
}
1620+
16121621
fn render_struct<'b>(&'b self) -> impl fmt::Display + Captures<'a> + 'b + Captures<'cx> {
16131622
display_fn(move |f| {
16141623
let cx = self.cx.borrow();

src/librustdoc/html/templates/item_struct.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<pre class="rust item-decl"><code>
2-
{{ self::render_attributes_in_code(self.it, self.cx.borrow().tcx()) | safe }}
2+
{{ self.render_attributes_in_code() | safe }}
33
{{ self.render_struct() | safe }}
44
</code></pre>
55
{{ self.document() | safe }}

0 commit comments

Comments
 (0)