Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

libsyntax JSON output bytes counts ignore CRLF normalization #65029

Closed

Description

@Rantanen

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

Activity

  1. added
    A-parser
    C-bug
    T-compiler
    on Oct 2, 2019
  2. petrochenkov commented on Oct 3, 2019

    @petrochenkov
    Contributor
  3. added 2 commits that reference this issue on Oct 8, 2019
    9568911
    3e390d5
  4. added 2 commits that reference this issue on Oct 25, 2019
    1c82167
    1f93be1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-parserC-bugT-compiler

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions