about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2021-10-01 11:46:34 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2021-10-01 21:24:05 +0200
commit3792be6ac94186f3cffeaea98eff7477a0b1776f (patch)
treef9798774504b694bd30d8e6675348ac2a8845069
parent69c1c6a173dcae20c245348f6c7d19074b6109b7 (diff)
downloadrust-3792be6ac94186f3cffeaea98eff7477a0b1776f.tar.gz
rust-3792be6ac94186f3cffeaea98eff7477a0b1776f.zip
Replace whitespaces in doctests' name with dashes
-rw-r--r--src/librustdoc/doctest.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/librustdoc/doctest.rs b/src/librustdoc/doctest.rs
index ac760fad103..43abcf095d8 100644
--- a/src/librustdoc/doctest.rs
+++ b/src/librustdoc/doctest.rs
@@ -853,6 +853,7 @@ impl Collector {
 
     fn generate_name(&self, line: usize, filename: &FileName) -> String {
         let mut item_path = self.names.join("::");
+        item_path.retain(|c| c != ' ');
         if !item_path.is_empty() {
             item_path.push(' ');
         }