Skip to content

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

Open

Description

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-parserArea: The parsing of Rust source code to an ASTA-unicodeArea: UnicodeT-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