Add a clickable link to the layout section

This commit is contained in:
est31 2022-07-25 00:35:58 +02:00
parent 2a990f7c0f
commit 5fcd2f72fe
3 changed files with 7 additions and 1 deletions

View file

@ -1485,6 +1485,7 @@ fn init_id_map() -> FxHashMap<Cow<'static, str>, usize> {
map.insert("synthetic-implementations-list".into(), 1);
map.insert("blanket-implementations-list".into(), 1);
map.insert("deref-methods".into(), 1);
map.insert("layout".into(), 1);
map
}

View file

@ -1869,7 +1869,11 @@ fn document_type_layout(w: &mut Buffer, cx: &Context<'_>, ty_def_id: DefId) {
return;
}
writeln!(w, "<h2 class=\"small-section-header\">Layout</h2>");
writeln!(
w,
"<h2 id=\"layout\" class=\"small-section-header\"> \
Layout<a href=\"#layout\" class=\"anchor\"></a></h2>"
);
writeln!(w, "<div class=\"docblock\">");
let tcx = cx.tcx();