Files
rust/tests/ui
Yuri Astrakhan aaa5bd244e Add useless_borrows_in_formatting lint
Detect format macros where an argument
is passed with an explicit `&` even though the formatter already takes
references, e.g. `println!("{}", &s)` when `s: &str`.

Some original micro-benchmarks showed ~6% performance improvement when redundant refs are removed.

- Lint runs for both Display (`{}`) and Debug (`{:?}`) placeholders when
  the inner type is Sized and implements the corresponding trait.
- Applies to the main value argument and to width/precision arguments
  (e.g. `format!("{0:1$.2$}", &v1, &v2, &v3)`).
- Suggests removing the redundant `&` with MachineApplicable fix.
- Skip when the argument comes from expansion or a proc macro.
2026-04-17 11:04:55 -04:00
..
2025-11-12 14:43:05 +01:00
2025-06-18 10:20:46 +02:00
2025-07-13 13:50:01 +00:00
2026-02-16 12:24:15 +00:00
2026-02-16 12:24:15 +00:00
2026-02-16 12:24:15 +00:00
2025-07-13 13:50:01 +00:00
2026-03-14 20:43:57 +00:00
2025-11-08 13:50:48 -05:00
2025-11-08 13:50:48 -05:00
2025-11-08 13:50:48 -05:00