diff options
| author | Oliver Schneider <github35764891676564198441@oli-obk.de> | 2018-06-03 11:24:58 +0200 |
|---|---|---|
| committer | Oliver Schneider <github35764891676564198441@oli-obk.de> | 2018-06-03 11:24:58 +0200 |
| commit | 9a16bbd9487b5b639230b673a40c54efa14f65ee (patch) | |
| tree | 9a5b2c974aefedc43cac106679f9ee74af797d4d | |
| parent | 3575be60eab140e69e5a75fe5c3b4119c2a17179 (diff) | |
Also prevent overflow in debug builds
| -rw-r--r-- | src/librustc_errors/emitter.rs | 2 |
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; |
