Skip to content

Commit 04ba153

Browse files
authored
Rollup merge of #89422 - GuillaumeGomez:doctest-whitespace-name, r=CraftSpider
Replace whitespaces in doctests' name with dashes Fixes #88263. Instead of handling white spaces when we filter tests (which would be quite complicated since we split on them!), I propose to instead replace them with dashes. So for example, this: ```console test foo.rs - Iter2<T, P>::len (line 13) ... ok test foo.rs - Iter<T, P>::len (line 4) ... ok ``` becomes: ```console test foo.rs - Iter<T,-P>::len (line 4) ... ok test foo.rs - Iter2<T,-P>::len (line 13) ... ok ``` r? `@jyn514`
2 parents 1781e4b + 3792be6 commit 04ba153

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/librustdoc/doctest.rs

+1
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,7 @@ impl Collector {
853853

854854
fn generate_name(&self, line: usize, filename: &FileName) -> String {
855855
let mut item_path = self.names.join("::");
856+
item_path.retain(|c| c != ' ');
856857
if !item_path.is_empty() {
857858
item_path.push(' ');
858859
}

0 commit comments

Comments
 (0)