Skip to content

Commit

Permalink
Add tcx local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
camelid committed May 11, 2021
1 parent db3a06d commit 8048c70
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/librustdoc/html/render/print_item.rs
Expand Up @@ -1540,9 +1540,10 @@ fn document_type_layout(w: &mut Buffer, cx: &Context<'_>, ty_def_id: DefId) {
return;
}

let param_env = cx.tcx().param_env(ty_def_id);
let ty = cx.tcx().type_of(ty_def_id);
match cx.tcx().layout_of(param_env.and(ty)) {
let tcx = cx.tcx();
let param_env = tcx.param_env(ty_def_id);
let ty = tcx.type_of(ty_def_id);
match tcx.layout_of(param_env.and(ty)) {
Ok(ty_layout) => {
writeln!(w, "<h2 class=\"small-section-header\">Layout</h2>");
writeln!(w, "<div class=\"docblock\">");
Expand Down

0 comments on commit 8048c70

Please sign in to comment.