Closed
Description
Summary
Nightly clippy fixes ``uninlined_format_args` incorrectly when a unicode character is involved:
Reproducer
I tried this code (https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=795eeb30bacb8129ad8b2d07cfd2703c):
pub fn foo() {
let a = "a";
let b = "b";
println!("{}\u{2794}{}", a, b);
}
warning: variables can be used directly in the `format!` string
--> src/lib.rs:5:5
|
5 | println!("{}\u{2794}{}", a, b);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
= note: `#[warn(clippy::uninlined_format_args)]` on by default
help: change this to
|
5 - println!("{}\u{2794}{}", a, b);
5 + println!("{a}\u{2794}{}"b, a);
|
warning: `playground` (lib) generated 1 warning
Version
rustc 1.66.0-nightly (bed4ad65b 2022-10-25)
binary: rustc
commit-hash: bed4ad65bf7a1cef39e3d66b3670189581b3b073
commit-date: 2022-10-25
host: x86_64-unknown-linux-gnu
release: 1.66.0-nightly
LLVM version: 15.0.2
Additional Labels
No response