Skip to content

Confusing error message in the presence of unicode combining characters #100388

Open
@Mandragorian

Description

@Mandragorian

Given the following code:

fn main() {
    println!("hello {}"̣, 1);
}

Playground link

The current output is:

error: unknown start of token: \u{323}
 --> src/main.rs:2:23
  |
2 |     println!("hello{}"̣, 1);
  |                       ^

error: could not compile `playground` due to previous error

Ideally the output should look like:

error: unknown start of token: \u{323}
 --> src/main.rs:2:23
  |
2 |     println!("hello{}"\u{323}, 1);
  |                       ^
help: Unicode character '\u{323}' might not be visible when rendered
error: could not compile `playground` due to previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-UnicodeArea: UnicodeA-diagnosticsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions