diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index d7d30f065bf..de117b44b6f 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -319,6 +319,7 @@ pub fn maketest(s: &str, cratename: Option<&str>, dont_insert_main: bool, } else { prog.push_str("fn main() {\n "); prog.push_str(&everything_else.replace("\n", "\n ")); + prog = prog.trim().into(); prog.push_str("\n}"); }