about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorLieselotte <52315535+she3py@users.noreply.github.com>2024-04-25 13:09:13 +0200
committerLieselotte <52315535+she3py@users.noreply.github.com>2024-04-25 13:09:13 +0200
commitb52e4bd99709fdf3c9b709f285d0ab4278fbcf8f (patch)
treeedc4f3a7424b042af3539320cae54d82756bb658 /compiler/rustc_errors/src
parent865808b33bfc7861c28ba6111ed4eac45cbeeeb4 (diff)
downloadrust-b52e4bd99709fdf3c9b709f285d0ab4278fbcf8f.tar.gz
rust-b52e4bd99709fdf3c9b709f285d0ab4278fbcf8f.zip
Fix substitution parts having a shifted underline in some cases
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/emitter.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs
index 6ce3fa3535d..6074a4a30bb 100644
--- a/compiler/rustc_errors/src/emitter.rs
+++ b/compiler/rustc_errors/src/emitter.rs
@@ -2019,7 +2019,7 @@ impl HumanEmitter {
                     let offset: isize = offsets
                         .iter()
                         .filter_map(
-                            |(start, v)| if span_start_pos <= *start { None } else { Some(v) },
+                            |(start, v)| if span_start_pos < *start { None } else { Some(v) },
                         )
                         .sum();
                     let underline_start = (span_start_pos + start) as isize + offset;
@@ -2028,7 +2028,7 @@ impl HumanEmitter {
                     let padding: usize = max_line_num_len + 3;
                     for p in underline_start..underline_end {
                         if let DisplaySuggestion::Underline = show_code_change {
-                            // If this is a replacement, underline with `^`, if this is an addition
+                            // If this is a replacement, underline with `~`, if this is an addition
                             // underline with `+`.
                             buffer.putc(
                                 row_num,