Skip to content

Multiline strings with carriage return - unknown string escape #11669

Closed
@adam-frisby

Description

@adam-frisby

Using Windows style (or Mac OS 9) style line endings results in "unknown string escape: \r" when attempting to use a multiline string literal.

test.rs:2:26: 2:27 error: unknown string escape: \r
test.rs:2   let string = ~"This is \
                                    ^
fn main() {
    let string = "This is \
                  a test";
}

When cloning a rust library, git automatically converted the Linux style line endings to Windows which caused compilation to fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-windowsOperating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions