Skip to content

Unnecessary "{}" suggestion for panic with const string #82026

Description

@ldm0

#78088 implements suggestion for panic with first argument not literal, but forget to handle such code:

const ICE: &str = "Internal compiler error";
fn main() {
    panic!(ICE);
}

This code is actually legit., but non_fmt_panic suggestion is emitted.
Check: https://gist.github.com/6002a4f7fedfda0e615d0b1158015eee

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions