Skip to content

Commit

Permalink
Use from_inner_byte_pos for cleaner code
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Jun 7, 2018
1 parent 7d0b6b7 commit 31bb50b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1218,9 +1218,10 @@ fn resolution_failure(
};

// Extract the specific span
let lo = sp.lo() + syntax_pos::BytePos((link_range.start + code_dox_len) as u32);
let hi = lo + syntax_pos::BytePos(link_range.len() as u32);
let sp = sp.with_lo(lo).with_hi(hi);
let sp = sp.from_inner_byte_pos(
link_range.start + code_dox_len,
link_range.end + code_dox_len,
);

diag = cx.sess().struct_span_warn(sp, &msg);
diag.span_label(sp, "cannot be resolved, ignoring");
Expand Down

0 comments on commit 31bb50b

Please sign in to comment.