From 27b58edc2391c6ff3779c09790ac7e38d8c6daac Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 13 Nov 2019 20:54:43 +0100 Subject: [PATCH] Update rustc --explain to the new error codes format --- src/librustc_driver/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 514c6d0e1da..d4f796ee3a7 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -524,13 +524,13 @@ fn handle_explain(code: &str, let mut text = String::new(); // Slice off the leading newline and print. - for line in description[1..].lines() { + for line in description.lines() { let indent_level = line.find(|c: char| !c.is_whitespace()) .unwrap_or_else(|| line.len()); let dedented_line = &line[indent_level..]; if dedented_line.starts_with("```") { is_in_code_block = !is_in_code_block; - text.push_str(&line[..(indent_level+3)]); + text.push_str(&line[..(indent_level + 3)]); } else if is_in_code_block && dedented_line.starts_with("# ") { continue; } else {