Use the correct span for displaying the line following a derive suggestion
This commit is contained in:
parent
39f42ad9e8
commit
20a3b9a215
2 changed files with 2 additions and 2 deletions
|
@ -1982,7 +1982,7 @@ impl EmitterWriter {
|
|||
// We special case `#[derive(_)]\n` and other attribute suggestions, because those
|
||||
// are the ones where context is most useful.
|
||||
let file_lines = sm
|
||||
.span_to_lines(span.primary_span().unwrap().shrink_to_hi())
|
||||
.span_to_lines(parts[0].span.shrink_to_hi())
|
||||
.expect("span_to_lines failed when emitting suggestion");
|
||||
let line_num = sm.lookup_char_pos(parts[0].span.lo()).line;
|
||||
if let Some(line) = file_lines.file.get_line(line_num - 1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue