Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 8048c70

Browse files
committed
Add tcx local variable
1 parent db3a06d commit 8048c70

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/librustdoc/html/render/print_item.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,9 +1540,10 @@ fn document_type_layout(w: &mut Buffer, cx: &Context<'_>, ty_def_id: DefId) {
15401540
return;
15411541
}
15421542

1543-
let param_env = cx.tcx().param_env(ty_def_id);
1544-
let ty = cx.tcx().type_of(ty_def_id);
1545-
match cx.tcx().layout_of(param_env.and(ty)) {
1543+
let tcx = cx.tcx();
1544+
let param_env = tcx.param_env(ty_def_id);
1545+
let ty = tcx.type_of(ty_def_id);
1546+
match tcx.layout_of(param_env.and(ty)) {
15461547
Ok(ty_layout) => {
15471548
writeln!(w, "<h2 class=\"small-section-header\">Layout</h2>");
15481549
writeln!(w, "<div class=\"docblock\">");

0 commit comments

Comments
 (0)