Skip to main content

## MALFORMED_DIAGNOSTIC_FORMAT_LITERALS

# Static MALFORMED_DIAGNOSTIC_FORMAT_LITERALS

Source

    pub static MALFORMED_DIAGNOSTIC_FORMAT_LITERALS: &Lint

Expand description

The `malformed_diagnostic_format_literals` lint detects malformed diagnostic format literals.

#### §Example

    #[diagnostic::on_unimplemented(message = "{Self}} does not implement `Trait`")]
    trait Trait {}

{{produces}}

#### §Explanation

The `#[diagnostic::on_unimplemented]` attribute accepts string literal values that are similar to `format!`’s string literal. See the reference for details on what is permitted in this string literal.