Skip to content

Commit

Permalink
Rollup merge of rust-lang#65120 - AnthonyMikh:fix_65119, r=estebank
Browse files Browse the repository at this point in the history
Correctly estimate the required space for string in `StyledBuffer::prepend`

Fix rust-lang#65119

r? @estebank
  • Loading branch information
Centril authored Oct 8, 2019
2 parents 53af7b3 + 4414068 commit 4999b29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_errors/styled_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl StyledBuffer {

pub fn prepend(&mut self, line: usize, string: &str, style: Style) {
self.ensure_lines(line);
let string_len = string.len();
let string_len = string.chars().count();

// Push the old content over to make room for new content
for _ in 0..string_len {
Expand Down

0 comments on commit 4999b29

Please sign in to comment.