diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-10-08 15:45:28 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-08 15:45:28 +0200 |
| commit | 153d3c3ea76ed704bf1b9a4dde1e0d2cb36aaabe (patch) | |
| tree | d16fff597d7cc1b7ecb7d7dc4e30143ff00be289 /src/librustc_errors | |
| parent | 3c5f8a1da06204c9e22f53ad3930fdc5c48e13a5 (diff) | |
| parent | 4414068cc49803b0dacba133b7788b8b95b0b473 (diff) | |
| download | rust-153d3c3ea76ed704bf1b9a4dde1e0d2cb36aaabe.tar.gz rust-153d3c3ea76ed704bf1b9a4dde1e0d2cb36aaabe.zip | |
Rollup merge of #65120 - AnthonyMikh:fix_65119, r=estebank
Correctly estimate the required space for string in `StyledBuffer::prepend` Fix #65119 r? @estebank
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/styled_buffer.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_errors/styled_buffer.rs b/src/librustc_errors/styled_buffer.rs index 6e03618d2b0..b12ab9e4576 100644 --- a/src/librustc_errors/styled_buffer.rs +++ b/src/librustc_errors/styled_buffer.rs @@ -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 { |
