Closed
Description
Recently there was a change in rustc to normalize newlines (CRLF -> LF) early during processing (#62948). This caused a change in the JSON output offsets. While the line/column values were unaffected (since they do not include the newlines in the counts), the byte_start
/byte_end
values were affected as they are calculated from the spans that use post-normalization positions.
As a result, the byte_start
/byte_end
values cannot be used to index the actual bytes of the original file, if the original file content was affected by the CRLF normalization. This is most evident in rustfix on Windows.
The original discussion is in the rustfix issue at rust-lang/rustfix#176