Auto merge of #51324 - oli-obk:debug_overflow, r=estebank

Also prevent overflow in debug builds

r? @estebank
This commit is contained in:
bors
2018-06-05 07:14:52 +00:00
+1 -1
View File
@@ -1287,7 +1287,7 @@ fn emit_suggestion_default(&mut self,
});
// 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;