diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-09-18 10:21:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-09-18 10:21:35 +0200 |
| commit | 6aed133ebde9f3e9e9ad779a02092cdf59fbd986 (patch) | |
| tree | bc91e386d846406de4b162ddfcc9de5cbfd512e6 | |
| parent | 3cdebfb010291a3293c27b5831fd2444cc3a7c49 (diff) | |
| parent | 1a0e8f95f54195831fe681dc4e4f4fa97d96e20e (diff) | |
| download | rust-6aed133ebde9f3e9e9ad779a02092cdf59fbd986.tar.gz rust-6aed133ebde9f3e9e9ad779a02092cdf59fbd986.zip | |
Rollup merge of #54097 - GuillaumeGomez:remove-keyword-namespace, r=QuietMisdreavus
rustdoc: Remove namespace for keywords Fixes #54084. r? @QuietMisdreavus
| -rw-r--r-- | src/librustdoc/html/render.rs | 4 | ||||
| -rw-r--r-- | 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 75311d93851..1879abe659c 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1830,8 +1830,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 b255ffddafa..73a026c581b 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 |
