properly calculate spans for intra-doc link resolution errors

This commit is contained in:
QuietMisdreavus 2018-11-14 18:14:31 -06:00
parent 6f93e93af6
commit aa3d7a4e6e
3 changed files with 38 additions and 1 deletions

View file

@ -527,7 +527,7 @@ fn resolution_failure(
doc_comment_padding +
// Each subsequent leading whitespace and `///`
code_dox.lines().skip(1).take(line_offset - 1).fold(0, |sum, line| {
sum + doc_comment_padding + line.len() - line.trim().len()
sum + doc_comment_padding + line.len() - line.trim_start().len()
})
};