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.
Problem
rust-clippyPR#17060 fixed a false-negative forclippy::useless_formatby changing how it resolves aformat!call's context inside macros.In dev builds, this hits
ifmt.rs's simple expression block wherequote_spanned! { raw.span() => ::std::format!(#raw) }gives the generatedformat!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:
cargo +nightly clippyand notice the lint fires.cargo +nightly clippy --releaseand notice the lint doesn't fire.Expected behavior
Clean
cargo clippyEnvironment:
Questionnaire
I would like to fix and I have a solution.