Skip to content

Commit 4999b29

Browse files
authored
Rollup merge of rust-lang#65120 - AnthonyMikh:fix_65119, r=estebank
Correctly estimate the required space for string in `StyledBuffer::prepend` Fix rust-lang#65119 r? @estebank
2 parents 53af7b3 + 4414068 commit 4999b29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_errors/styled_buffer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl StyledBuffer {
111111

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

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

0 commit comments

Comments
 (0)