about summary refs log tree commit diff
path: root/src/librustc_errors
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-12-07 12:42:32 +0800
committerGitHub <noreply@github.com>2018-12-07 12:42:32 +0800
commit0e41ef13aac432d7c33f9e1287270769deb69c3f (patch)
tree4bf4ba43ba7add944b6e078511960fbf1876dc9c /src/librustc_errors
parent6a07f23c78dde6368e4566218aef4c38d9d64ec6 (diff)
parentc025d6140999e07ddf0294f0676c64ff2322a210 (diff)
downloadrust-0e41ef13aac432d7c33f9e1287270769deb69c3f.tar.gz
rust-0e41ef13aac432d7c33f9e1287270769deb69c3f.zip
Rollup merge of #56516 - frewsxcv:frewsxcv-eq, r=Mark-Simulacrum
Replace usages of `..i + 1` ranges with `..=i`.

Before this change we were using old computer code techniques. After this change we use the new and improved computer code techniques.
Diffstat (limited to 'src/librustc_errors')
-rw-r--r--src/librustc_errors/emitter.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs
index ab2ab25c91a..ae9f6a5e140 100644
--- a/src/librustc_errors/emitter.rs
+++ b/src/librustc_errors/emitter.rs
@@ -549,7 +549,7 @@ impl EmitterWriter {
         // 3 |
         // 4 |   }
         //   |
-        for pos in 0..line_len + 1 {
+        for pos in 0..=line_len {
             draw_col_separator(buffer, line_offset + pos + 1, width_offset - 2);
             buffer.putc(line_offset + pos + 1,
                         width_offset - 2,
@@ -617,7 +617,7 @@ impl EmitterWriter {
             let pos = pos + 1;
 
             if pos > 1 && (annotation.has_label() || annotation.takes_space()) {
-                for p in line_offset + 1..line_offset + pos + 1 {
+                for p in line_offset + 1..=line_offset + pos {
                     buffer.putc(p,
                                 code_offset + annotation.start_col,
                                 '|',
@@ -634,7 +634,7 @@ impl EmitterWriter {
                     }
                 }
                 AnnotationType::MultilineEnd(depth) => {
-                    for p in line_offset..line_offset + pos + 1 {
+                    for p in line_offset..=line_offset + pos {
                         buffer.putc(p,
                                     width_offset + depth - 1,
                                     '|',