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
commit f33db06e1d

View File

@ -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;