From 3792be6ac94186f3cffeaea98eff7477a0b1776f Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 1 Oct 2021 11:46:34 +0200 Subject: [PATCH] Replace whitespaces in doctests' name with dashes --- src/librustdoc/doctest.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustdoc/doctest.rs b/src/librustdoc/doctest.rs index ac760fad103c1..43abcf095d858 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(' '); }