From 31bb50b6b949aa19fc6d5ed76a4d458e8a5af8a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Thu, 7 Jun 2018 09:47:09 -0700 Subject: [PATCH] Use `from_inner_byte_pos` for cleaner code --- src/librustdoc/clean/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 226b3627e3e..e24c1a23b89 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -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");