Add tcx local variable

This commit is contained in:
Camelid 2021-04-13 18:33:25 -07:00
parent db3a06d01e
commit 8048c70568

View File

@ -1540,9 +1540,10 @@ fn document_type_layout(w: &mut Buffer, cx: &Context<'_>, ty_def_id: DefId) {
return; return;
} }
let param_env = cx.tcx().param_env(ty_def_id); let tcx = cx.tcx();
let ty = cx.tcx().type_of(ty_def_id); let param_env = tcx.param_env(ty_def_id);
match cx.tcx().layout_of(param_env.and(ty)) { let ty = tcx.type_of(ty_def_id);
match tcx.layout_of(param_env.and(ty)) {
Ok(ty_layout) => { Ok(ty_layout) => {
writeln!(w, "<h2 class=\"small-section-header\">Layout</h2>"); writeln!(w, "<h2 class=\"small-section-header\">Layout</h2>");
writeln!(w, "<div class=\"docblock\">"); writeln!(w, "<div class=\"docblock\">");