Skip to content

Strange error message for incorrect format string #9931

Closed
@bstrie

Description

@bstrie

This program:

fn main() {
    println!("{:f.6}", 100.0);
}

...has this output:

ac.rs:2:13: 2:21 error: unterminated format string
ac.rs:2     println!("{:f.6}", 100.0);
                     ^~~~~~~~
error: aborting due to previous error

"unterminated" makes it sound as though the user hasn't used a closing quotation mark. Even if it's not possible to give a good error message here, a message like "unknown format specifier" would be more insightful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions