Skip to content

Nightly clippy emits clippy::useless_format for bare interpolations in dev builds. #5635

Description

@scottfones

Problem

rust-clippy PR#17060 fixed a false-negative for clippy::useless_format by changing how it resolves a format! call's context inside macros.

In dev builds, this hits ifmt.rs's simple expression block where quote_spanned! { raw.span() => ::std::format!(#raw) } gives the generated format! the user's source span. As a result, the format call is analyzed as the user's code rather than belonging to the macro expansion.

Steps To Reproduce

Steps to reproduce the behavior:

  • Create a bare interpolation element.
pub fn clippy_render(label: &str) -> Element {
    rsx! {
        span { "{label}" }
    }
}
  • Run cargo +nightly clippy and notice the lint fires.
  • Run cargo +nightly clippy --release and notice the lint doesn't fire.

Expected behavior

Clean cargo clippy

Environment:

  • Dioxus version: v0.7.9
  • Rust version: rustc 1.98.0-nightly (9e2abe0c6 2026-06-16), should hit on any nightly since 2026-05-30
  • OS info: Linux (7.0.11-arch1-1)
  • App platform: Web

Questionnaire

I would like to fix and I have a solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions