Skip to content

Unmatched brace in a format string crashes the compiler #91556

Closed

Description

@VorfeedCanal

Reproducer:

pub fn test(i: i32) -> String {
  format!(concat!("{0}𝖳𝖾𝗌𝗍{"), i)
}

Playground link: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=8b3a4c8413cd9d296706c9da0ac6e0c0

Activity

  1. added
    C-bugCategory: This is a bug.
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Dec 5, 2021
  2. compiler-errors commented on Dec 5, 2021

    @compiler-errors
    Contributor

    I'd love to take a look at this. Seems to be ICEing in code that displays the diagnostic to fixup the actual compiler error here.

    @rustbot claim

  3. added 4 commits that reference this issue on Dec 9, 2021
    999bb90
    d2d0b0b
    6ec2bcb
    6cfe9af
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️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