Skip to content

Commit 6aed133

Browse files
Rollup merge of rust-lang#54097 - GuillaumeGomez:remove-keyword-namespace, r=QuietMisdreavus
rustdoc: Remove namespace for keywords Fixes rust-lang#54084. r? @QuietMisdreavus
2 parents 3cdebfb + 1a0e8f9 commit 6aed133

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/librustdoc/html/render.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1830,8 +1830,8 @@ impl Context {
18301830
*slot.borrow_mut() = self.current.clone();
18311831
});
18321832

1833-
let mut title = if it.is_primitive() {
1834-
// No need to include the namespace for primitive types
1833+
let mut title = if it.is_primitive() || it.is_keyword() {
1834+
// No need to include the namespace for primitive types and keywords
18351835
String::new()
18361836
} else {
18371837
self.current.join("::")

src/test/rustdoc/keyword.rs

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// @has foo/index.html '//h2[@id="keywords"]' 'Keywords'
1616
// @has foo/index.html '//a[@href="keyword.match.html"]' 'match'
1717
// @has foo/keyword.match.html '//a[@class="keyword"]' 'match'
18+
// @has foo/keyword.match.html '//span[@class="in-band"]' 'Keyword match'
1819
// @has foo/keyword.match.html '//section[@id="main"]//div[@class="docblock"]//p' 'this is a test!'
1920
// @!has foo/index.html '//a/@href' 'foo/index.html'
2021
// @!has foo/foo/index.html

0 commit comments

Comments
 (0)