Skip to content

Strange formatting for 'more than one codepoint in char' error message #38434

Closed
@frewsxcv

Description

@frewsxcv

Code (playpen)

fn main() {
    let heart = '❤️';
}

Error:

error: character literal may only contain one codepoint: '❤
 --> <anon>:2:17
  |
2 |     let heart = '❤️';
  |                 ^^

error: aborting due to previous error

Why do we only show one quotation mark ('❤) in the first line of the error? Seems like we should either display both or none

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-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