From 1a0e8f95f54195831fe681dc4e4f4fa97d96e20e Mon Sep 17 00:00:00 2001
From: Guillaume Gomez <guillaume1.gomez@gmail.com>
Date: Mon, 10 Sep 2018 11:27:21 +0200
Subject: [PATCH] Remove namespace for keywords

---
 src/librustdoc/html/render.rs | 4 ++--
 src/test/rustdoc/keyword.rs   | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 972c2f0e15c5e..3dc55c5556b7f 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -1827,8 +1827,8 @@ impl Context {
             *slot.borrow_mut() = self.current.clone();
         });
 
-        let mut title = if it.is_primitive() {
-            // No need to include the namespace for primitive types
+        let mut title = if it.is_primitive() || it.is_keyword() {
+            // No need to include the namespace for primitive types and keywords
             String::new()
         } else {
             self.current.join("::")
diff --git a/src/test/rustdoc/keyword.rs b/src/test/rustdoc/keyword.rs
index b255ffddafac8..73a026c581be5 100644
--- a/src/test/rustdoc/keyword.rs
+++ b/src/test/rustdoc/keyword.rs
@@ -15,6 +15,7 @@
 // @has foo/index.html '//h2[@id="keywords"]' 'Keywords'
 // @has foo/index.html '//a[@href="keyword.match.html"]' 'match'
 // @has foo/keyword.match.html '//a[@class="keyword"]' 'match'
+// @has foo/keyword.match.html '//span[@class="in-band"]' 'Keyword match'
 // @has foo/keyword.match.html '//section[@id="main"]//div[@class="docblock"]//p' 'this is a test!'
 // @!has foo/index.html '//a/@href' 'foo/index.html'
 // @!has foo/foo/index.html