about summary refs log tree commit diff
path: root/src/librustc_errors
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2018-12-04 11:17:58 -0800
committerCorey Farwell <coreyf@rwell.org>2018-12-04 12:05:19 -0800
commitc025d6140999e07ddf0294f0676c64ff2322a210 (patch)
tree51430da0c1c62d653d24db743ffd5e6f0d39bf8d /src/librustc_errors
parent431e0ab62f7730f11db693c23f48403e4c719f82 (diff)
downloadrust-c025d6140999e07ddf0294f0676c64ff2322a210.tar.gz
rust-c025d6140999e07ddf0294f0676c64ff2322a210.zip
Replace usages of `..i + 1` ranges with `..=i`.
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 7e69e98071d..aa8b53ff375 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,
                                     '|',