We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 779e19d commit ad02716Copy full SHA for ad02716
compiler/rustc_errors/src/emitter.rs
@@ -2154,7 +2154,11 @@ impl HumanEmitter {
2154
2155
assert!(!file_lines.lines.is_empty() || parts[0].span.is_dummy());
2156
2157
- let line_start = sm.lookup_char_pos(parts[0].span.lo()).line;
+ let line_start = if let Some(span) = span.primary_spans().get(i) {
2158
+ sm.lookup_char_pos(span.lo()).line
2159
+ } else {
2160
+ sm.lookup_char_pos(parts[0].span.lo()).line
2161
+ };
2162
let mut lines = complete.lines();
2163
if lines.clone().next().is_none() {
2164
// Account for a suggestion to completely remove a line(s) with whitespace (#94192).
0 commit comments