about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Schneider <github35764891676564198441@oli-obk.de>2018-06-03 11:24:58 +0200
committerOliver Schneider <github35764891676564198441@oli-obk.de>2018-06-03 11:24:58 +0200
commit9a16bbd9487b5b639230b673a40c54efa14f65ee (patch)
tree9a5b2c974aefedc43cac106679f9ee74af797d4d
parent3575be60eab140e69e5a75fe5c3b4119c2a17179 (diff)
Also prevent overflow in debug builds
-rw-r--r--src/librustc_errors/emitter.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs
index f65acf08c86..92e72fe91d3 100644
--- a/src/librustc_errors/emitter.rs
+++ b/src/librustc_errors/emitter.rs
@@ -1287,7 +1287,7 @@ impl EmitterWriter {
                         });
 
                         // length of the code to be substituted
-                        let snippet_len = (span_end_pos - span_start_pos) as isize;
+                        let snippet_len = span_end_pos as isize - span_start_pos as isize;
                         // For multiple substitutions, use the position *after* the previous
                         // substitutions have happened.
                         offset += full_sub_len - snippet_len;