Skip to content

Commit 49c9b22

Browse files
authored
Rollup merge of rust-lang#62971 - GuillaumeGomez:keyword-sidebar, r=nobody
Add keywords item into the sidebar Fixes rust-lang#62939. cc @pravic screenshot of the result: ![Screenshot from 2019-07-25 14-29-48](https://user-images.githubusercontent.com/3050060/61874545-f9512080-aee8-11e9-8e8b-aa50216aec94.png) r? @QuietMisdreavus
2 parents e3976ff + 08a8de8 commit 49c9b22

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/librustdoc/html/render.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -5007,7 +5007,8 @@ fn sidebar_module(fmt: &mut fmt::Formatter<'_>, _it: &clean::Item,
50075007
ItemType::Enum, ItemType::Constant, ItemType::Static, ItemType::Trait,
50085008
ItemType::Function, ItemType::Typedef, ItemType::Union, ItemType::Impl,
50095009
ItemType::TyMethod, ItemType::Method, ItemType::StructField, ItemType::Variant,
5010-
ItemType::AssocType, ItemType::AssocConst, ItemType::ForeignType] {
5010+
ItemType::AssocType, ItemType::AssocConst, ItemType::ForeignType,
5011+
ItemType::Keyword] {
50115012
if items.iter().any(|it| !it.is_stripped() && it.type_() == myty) {
50125013
let (short, name) = item_ty_to_strs(&myty);
50135014
sidebar.push_str(&format!("<li><a href=\"#{id}\">{name}</a></li>",

src/test/rustdoc/keyword.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
// @has foo/index.html '//h2[@id="keywords"]' 'Keywords'
66
// @has foo/index.html '//a[@href="keyword.match.html"]' 'match'
7+
// @has foo/index.html '//div[@class="block items"]//a/@href' '#keywords'
78
// @has foo/keyword.match.html '//a[@class="keyword"]' 'match'
89
// @has foo/keyword.match.html '//span[@class="in-band"]' 'Keyword match'
910
// @has foo/keyword.match.html '//section[@id="main"]//div[@class="docblock"]//p' 'this is a test!'

0 commit comments

Comments
 (0)