Skip to content

Invalid char literal error message has an unhelpful snippet #30033

Closed
@apasel422

Description

@apasel422

foo.rs:

fn main() {
    let _ = 'ab';
}
foo.rs:2:16: 2:18 error: character literal may only contain one codepoint: ';
foo.rs:2     let _ = 'ab';
                        ^~

The snippet at the end of the error message is not helpful, and should probably encompass everything between the two 's.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an AST

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions