Use a span from the correct file for the inner span of a module
This basically only affects modules which are empty (or only contain comments). Closes #26755
This commit is contained in:
parent
bf34187a2f
commit
f47d20aecd
5 changed files with 29 additions and 13 deletions
|
@ -894,7 +894,7 @@ impl CodeMap {
|
|||
FileMapAndBytePos {fm: fm, pos: offset}
|
||||
}
|
||||
|
||||
/// Converts an absolute BytePos to a CharPos relative to the filemap and above.
|
||||
/// Converts an absolute BytePos to a CharPos relative to the filemap.
|
||||
pub fn bytepos_to_file_charpos(&self, bpos: BytePos) -> CharPos {
|
||||
let idx = self.lookup_filemap_idx(bpos);
|
||||
let files = self.files.borrow();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue