Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/librustdoc/html/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
6 changes: 5 additions & 1 deletion src/librustdoc/html/render/print_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions src/test/rustdoc/type-layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

// @has type_layout/struct.Foo.html 'Size: '
// @has - ' bytes'
// @matches - '<h2 id="layout".+Layout.+a href="#layout" class="anchor">'
pub struct Foo {
pub a: usize,
b: Vec<String>,
Expand Down