about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2016-05-01 18:13:36 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2016-05-01 18:13:36 +0200
commit47d9f49ebf3b32ac79011e282f5bd8d2dce2df39 (patch)
tree35a8bc19119709f6a82ce52f660dce674e7584ae
parent3157691f963a86776cb7e6a7842f566032890aba (diff)
downloadrust-47d9f49ebf3b32ac79011e282f5bd8d2dce2df39.tar.gz
rust-47d9f49ebf3b32ac79011e282f5bd8d2dce2df39.zip
Remove rust flags from doc block
-rw-r--r--src/librustc_driver/lib.rs8
1 files changed, 7 insertions, 1 deletions
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::<String>());
         }
         None => {
             early_error(output, &format!("no extended information for {}", code));