about summary refs log tree commit diff
path: root/src/librustc_errors
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2017-01-08 21:18:24 -0800
committerEsteban Küber <esteban@kuber.com.ar>2017-01-08 21:18:24 -0800
commit690476191db427ab8603876ef9a8a929222e71aa (patch)
tree17b768f8012c12121c5e5b036eec9b10ffc728d0 /src/librustc_errors
parentb206064fc86b356759e4cbfc60407b426c362cac (diff)
downloadrust-690476191db427ab8603876ef9a8a929222e71aa.tar.gz
rust-690476191db427ab8603876ef9a8a929222e71aa.zip
Remove magic number
Diffstat (limited to 'src/librustc_errors')
-rw-r--r--src/librustc_errors/emitter.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs
index dbef287f113..2640ff62d5b 100644
--- a/src/librustc_errors/emitter.rs
+++ b/src/librustc_errors/emitter.rs
@@ -737,8 +737,8 @@ impl EmitterWriter {
             buffer.append(0, &level.to_string(), Style::HeaderMsg);
             buffer.append(0, ": ", Style::NoStyle);
 
-            // The extra 9 ` ` is the padding that's always needed to align to the `note: `.
-            let message = self.msg_with_padding(msg, max_line_num_len + 9);
+            // The extra 3 ` ` is the padding that's always needed to align to the `note: `.
+            let message = self.msg_with_padding(msg, max_line_num_len + "note: ".len() + 3);
             buffer.append(0, &message, Style::NoStyle);
         } else {
             buffer.append(0, &level.to_string(), Style::Level(level.clone()));
@@ -873,8 +873,8 @@ impl EmitterWriter {
             buffer.append(0, &level.to_string(), Style::Level(level.clone()));
             buffer.append(0, ": ", Style::HeaderMsg);
 
-            // The extra 15 ` ` is the padding that's always needed to align to the `suggestion: `.
-            let message = self.msg_with_padding(msg, max_line_num_len + 15);
+            // The extra 3 ` ` is the padding that's always needed to align to the `suggestion: `.
+            let message = self.msg_with_padding(msg, max_line_num_len + "suggestion: ".len() + 3);
             buffer.append(0, &message, Style::HeaderMsg);
 
             let lines = cm.span_to_lines(primary_span).unwrap();