about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2018-06-10 19:43:28 -0700
committerEsteban Küber <esteban@kuber.com.ar>2018-06-11 15:52:10 -0700
commited5dcc31182631a8df8818f4896179177d607fcf (patch)
tree09c8adc02c78e7cf5cbcc23f8c13e1bc477c6efa
parentae0659c97d33eb4d9c84e0ec6a66b81a9e35ef1c (diff)
downloadrust-ed5dcc31182631a8df8818f4896179177d607fcf.tar.gz
rust-ed5dcc31182631a8df8818f4896179177d607fcf.zip
Remove highlighting from secondary messages
Deemphasize the secondary messages so that all other highlights stand
out more.
-rw-r--r--src/librustc_errors/emitter.rs14
-rw-r--r--src/librustc_errors/snippet.rs1
2 files changed, 11 insertions, 4 deletions
diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs
index 92e72fe91d3..45e8a3bf17e 100644
--- a/src/librustc_errors/emitter.rs
+++ b/src/librustc_errors/emitter.rs
@@ -963,6 +963,11 @@ impl EmitterWriter {
                             is_secondary: bool)
                             -> io::Result<()> {
         let mut buffer = StyledBuffer::new();
+        let header_style = if is_secondary {
+            Style::HeaderMsg
+        } else {
+            Style::MainHeaderMsg
+        };
 
         if msp.primary_spans().is_empty() && msp.span_labels().is_empty() && is_secondary
            && !self.short_message {
@@ -973,7 +978,7 @@ impl EmitterWriter {
             draw_note_separator(&mut buffer, 0, max_line_num_len + 1);
             let level_str = level.to_string();
             if !level_str.is_empty() {
-                buffer.append(0, &level_str, Style::HeaderMsg);
+                buffer.append(0, &level_str, Style::MainHeaderMsg);
                 buffer.append(0, ": ", Style::NoStyle);
             }
             self.msg_to_buffer(&mut buffer, msg, max_line_num_len, "note", None);
@@ -989,10 +994,10 @@ impl EmitterWriter {
                 buffer.append(0, "]", Style::Level(level.clone()));
             }
             if !level_str.is_empty() {
-                buffer.append(0, ": ", Style::HeaderMsg);
+                buffer.append(0, ": ", header_style);
             }
             for &(ref text, _) in msg.iter() {
-                buffer.append(0, text, Style::HeaderMsg);
+                buffer.append(0, text, header_style);
             }
         }
 
@@ -1521,7 +1526,7 @@ impl<'a> WritableDst<'a> {
                 }
             }
             Style::Quotation => {}
-            Style::OldSchoolNoteText | Style::HeaderMsg => {
+            Style::OldSchoolNoteText | Style::MainHeaderMsg => {
                 spec.set_bold(true);
                 if cfg!(windows) {
                     spec.set_intense(true)
@@ -1542,6 +1547,7 @@ impl<'a> WritableDst<'a> {
                     spec.set_fg(Some(Color::Blue));
                 }
             }
+            Style::HeaderMsg |
             Style::NoStyle => {}
             Style::Level(lvl) => {
                 spec = lvl.color();
diff --git a/src/librustc_errors/snippet.rs b/src/librustc_errors/snippet.rs
index 7d416f13ffc..002261dc1a5 100644
--- a/src/librustc_errors/snippet.rs
+++ b/src/librustc_errors/snippet.rs
@@ -182,6 +182,7 @@ pub struct StyledString {
 
 #[derive(Copy, Clone, Debug, PartialEq, Hash, RustcEncodable, RustcDecodable)]
 pub enum Style {
+    MainHeaderMsg,
     HeaderMsg,
     LineAndColumn,
     LineNumber,