From 47d9f49ebf3b32ac79011e282f5bd8d2dce2df39 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 1 May 2016 18:13:36 +0200 Subject: [PATCH] Remove rust flags from doc block --- src/librustc_driver/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 4aaeeed3430..3b25104437a 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -352,7 +352,13 @@ fn handle_explain(code: &str, match descriptions.find_description(&normalised) { Some(ref description) => { // Slice off the leading newline and print. - print!("{}", &description[1..]); + print!("{}", &(&description[1..]).split("\n").map(|x| { + format!("{}\n", if x.starts_with("```") { + "```" + } else { + x + }) + }).collect::()); } None => { early_error(output, &format!("no extended information for {}", code));