2023-04-20 09:37:15 -05:00
|
|
|
//@aux-build:proc_macros.rs
|
|
|
|
//@run-rustfix
|
2022-10-02 14:13:22 -05:00
|
|
|
#![warn(clippy::uninlined_format_args)]
|
2023-03-28 19:52:55 -05:00
|
|
|
#![allow(named_arguments_used_positionally, unused)]
|
2022-10-02 14:13:22 -05:00
|
|
|
#![allow(clippy::eq_op, clippy::format_in_format_args, clippy::print_literal)]
|
new uninlined_format_args lint to inline explicit arguments
Implement https://github.com/rust-lang/rust-clippy/issues/8368 - a new
lint to inline format arguments such as `print!("{}", var)` into
`print!("{var}")`.
code | suggestion | comment
---|---|---
`print!("{}", var)` | `print!("{var}")` | simple variables
`print!("{0}", var)` | `print!("{var}")` | positional variables
`print!("{v}", v=var)` | `print!("{var}")` | named variables
`print!("{0} {0}", var)` | `print!("{var} {var}")` | aliased variables
`print!("{0:1$}", var, width)` | `print!("{var:width$}")` | width
support
`print!("{0:.1$}", var, prec)` | `print!("{var:.prec$}")` | precision
support
`print!("{:.*}", prec, var)` | `print!("{var:.prec$}")` | asterisk
support
code | suggestion | comment
---|---|---
`print!("{0}={1}", var, 1+2)` | `print!("{var}={0}", 1+2)` | Format
string uses an indexed argument that cannot be inlined. Supporting this
case requires re-indexing of the format string.
changelog: [`uninlined_format_args`]: A new lint to inline format
arguments, i.e. `print!("{}", var)` into `print!("{var}")`
2022-09-14 11:25:48 -05:00
|
|
|
|
2023-03-07 08:40:55 -06:00
|
|
|
extern crate proc_macros;
|
|
|
|
use proc_macros::with_span;
|
2022-10-05 11:10:52 -05:00
|
|
|
|
new uninlined_format_args lint to inline explicit arguments
Implement https://github.com/rust-lang/rust-clippy/issues/8368 - a new
lint to inline format arguments such as `print!("{}", var)` into
`print!("{var}")`.
code | suggestion | comment
---|---|---
`print!("{}", var)` | `print!("{var}")` | simple variables
`print!("{0}", var)` | `print!("{var}")` | positional variables
`print!("{v}", v=var)` | `print!("{var}")` | named variables
`print!("{0} {0}", var)` | `print!("{var} {var}")` | aliased variables
`print!("{0:1$}", var, width)` | `print!("{var:width$}")` | width
support
`print!("{0:.1$}", var, prec)` | `print!("{var:.prec$}")` | precision
support
`print!("{:.*}", prec, var)` | `print!("{var:.prec$}")` | asterisk
support
code | suggestion | comment
---|---|---
`print!("{0}={1}", var, 1+2)` | `print!("{var}={0}", 1+2)` | Format
string uses an indexed argument that cannot be inlined. Supporting this
case requires re-indexing of the format string.
changelog: [`uninlined_format_args`]: A new lint to inline format
arguments, i.e. `print!("{}", var)` into `print!("{var}")`
2022-09-14 11:25:48 -05:00
|
|
|
macro_rules! no_param_str {
|
|
|
|
() => {
|
|
|
|
"{}"
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! my_println {
|
|
|
|
($($args:tt),*) => {{
|
|
|
|
println!($($args),*)
|
|
|
|
}};
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! my_println_args {
|
|
|
|
($($args:tt),*) => {{
|
|
|
|
println!("foo: {}", format_args!($($args),*))
|
|
|
|
}};
|
|
|
|
}
|
|
|
|
|
|
|
|
fn tester(fn_arg: i32) {
|
|
|
|
let local_i32 = 1;
|
|
|
|
let local_f64 = 2.0;
|
|
|
|
let local_opt: Option<i32> = Some(3);
|
|
|
|
let width = 4;
|
|
|
|
let prec = 5;
|
|
|
|
let val = 6;
|
|
|
|
|
|
|
|
// make sure this file hasn't been corrupted with tabs converted to spaces
|
|
|
|
// let _ = ' '; // <- this is a single tab character
|
|
|
|
let _: &[u8; 3] = b" "; // <- <tab><space><tab>
|
|
|
|
|
|
|
|
println!("val='{local_i32}'");
|
|
|
|
println!("val='{local_i32}'"); // 3 spaces
|
|
|
|
println!("val='{local_i32}'"); // tab
|
|
|
|
println!("val='{local_i32}'"); // space+tab
|
|
|
|
println!("val='{local_i32}'"); // tab+space
|
|
|
|
println!(
|
2022-11-25 09:36:22 -06:00
|
|
|
"val='{local_i32}'"
|
new uninlined_format_args lint to inline explicit arguments
Implement https://github.com/rust-lang/rust-clippy/issues/8368 - a new
lint to inline format arguments such as `print!("{}", var)` into
`print!("{var}")`.
code | suggestion | comment
---|---|---
`print!("{}", var)` | `print!("{var}")` | simple variables
`print!("{0}", var)` | `print!("{var}")` | positional variables
`print!("{v}", v=var)` | `print!("{var}")` | named variables
`print!("{0} {0}", var)` | `print!("{var} {var}")` | aliased variables
`print!("{0:1$}", var, width)` | `print!("{var:width$}")` | width
support
`print!("{0:.1$}", var, prec)` | `print!("{var:.prec$}")` | precision
support
`print!("{:.*}", prec, var)` | `print!("{var:.prec$}")` | asterisk
support
code | suggestion | comment
---|---|---
`print!("{0}={1}", var, 1+2)` | `print!("{var}={0}", 1+2)` | Format
string uses an indexed argument that cannot be inlined. Supporting this
case requires re-indexing of the format string.
changelog: [`uninlined_format_args`]: A new lint to inline format
arguments, i.e. `print!("{}", var)` into `print!("{var}")`
2022-09-14 11:25:48 -05:00
|
|
|
);
|
|
|
|
println!("{local_i32}");
|
|
|
|
println!("{fn_arg}");
|
|
|
|
println!("{local_i32:?}");
|
|
|
|
println!("{local_i32:#?}");
|
|
|
|
println!("{local_i32:4}");
|
|
|
|
println!("{local_i32:04}");
|
|
|
|
println!("{local_i32:<3}");
|
|
|
|
println!("{local_i32:#010x}");
|
|
|
|
println!("{local_f64:.1}");
|
2022-11-27 09:12:51 -06:00
|
|
|
println!("Hello {} is {:.*}", "x", local_i32, local_f64);
|
|
|
|
println!("Hello {} is {:.*}", local_i32, 5, local_f64);
|
|
|
|
println!("Hello {} is {2:.*}", local_i32, 5, local_f64);
|
new uninlined_format_args lint to inline explicit arguments
Implement https://github.com/rust-lang/rust-clippy/issues/8368 - a new
lint to inline format arguments such as `print!("{}", var)` into
`print!("{var}")`.
code | suggestion | comment
---|---|---
`print!("{}", var)` | `print!("{var}")` | simple variables
`print!("{0}", var)` | `print!("{var}")` | positional variables
`print!("{v}", v=var)` | `print!("{var}")` | named variables
`print!("{0} {0}", var)` | `print!("{var} {var}")` | aliased variables
`print!("{0:1$}", var, width)` | `print!("{var:width$}")` | width
support
`print!("{0:.1$}", var, prec)` | `print!("{var:.prec$}")` | precision
support
`print!("{:.*}", prec, var)` | `print!("{var:.prec$}")` | asterisk
support
code | suggestion | comment
---|---|---
`print!("{0}={1}", var, 1+2)` | `print!("{var}={0}", 1+2)` | Format
string uses an indexed argument that cannot be inlined. Supporting this
case requires re-indexing of the format string.
changelog: [`uninlined_format_args`]: A new lint to inline format
arguments, i.e. `print!("{}", var)` into `print!("{var}")`
2022-09-14 11:25:48 -05:00
|
|
|
println!("{local_i32} {local_f64}");
|
2022-11-27 09:12:51 -06:00
|
|
|
println!("{}, {}", local_i32, local_opt.unwrap());
|
new uninlined_format_args lint to inline explicit arguments
Implement https://github.com/rust-lang/rust-clippy/issues/8368 - a new
lint to inline format arguments such as `print!("{}", var)` into
`print!("{var}")`.
code | suggestion | comment
---|---|---
`print!("{}", var)` | `print!("{var}")` | simple variables
`print!("{0}", var)` | `print!("{var}")` | positional variables
`print!("{v}", v=var)` | `print!("{var}")` | named variables
`print!("{0} {0}", var)` | `print!("{var} {var}")` | aliased variables
`print!("{0:1$}", var, width)` | `print!("{var:width$}")` | width
support
`print!("{0:.1$}", var, prec)` | `print!("{var:.prec$}")` | precision
support
`print!("{:.*}", prec, var)` | `print!("{var:.prec$}")` | asterisk
support
code | suggestion | comment
---|---|---
`print!("{0}={1}", var, 1+2)` | `print!("{var}={0}", 1+2)` | Format
string uses an indexed argument that cannot be inlined. Supporting this
case requires re-indexing of the format string.
changelog: [`uninlined_format_args`]: A new lint to inline format
arguments, i.e. `print!("{}", var)` into `print!("{var}")`
2022-09-14 11:25:48 -05:00
|
|
|
println!("{val}");
|
|
|
|
println!("{val}");
|
|
|
|
println!("{} {1}", local_i32, 42);
|
|
|
|
println!("val='{local_i32}'");
|
|
|
|
println!("val='{local_i32}'");
|
|
|
|
println!("val='{local_i32}'");
|
|
|
|
println!("val='{fn_arg}'");
|
|
|
|
println!("{local_i32}");
|
|
|
|
println!("{local_i32:?}");
|
|
|
|
println!("{local_i32:#?}");
|
|
|
|
println!("{local_i32:04}");
|
|
|
|
println!("{local_i32:<3}");
|
|
|
|
println!("{local_i32:#010x}");
|
|
|
|
println!("{local_f64:.1}");
|
|
|
|
println!("{local_i32} {local_i32}");
|
|
|
|
println!("{local_f64} {local_i32} {local_i32} {local_f64}");
|
|
|
|
println!("{local_i32} {local_f64}");
|
|
|
|
println!("{local_f64} {local_i32}");
|
|
|
|
println!("{local_f64} {local_i32} {local_f64} {local_i32}");
|
|
|
|
println!("{1} {0}", "str", local_i32);
|
|
|
|
println!("{local_i32}");
|
|
|
|
println!("{local_i32:width$}");
|
|
|
|
println!("{local_i32:width$}");
|
|
|
|
println!("{local_i32:.prec$}");
|
|
|
|
println!("{local_i32:.prec$}");
|
|
|
|
println!("{val:val$}");
|
|
|
|
println!("{val:val$}");
|
|
|
|
println!("{val:val$.val$}");
|
|
|
|
println!("{val:val$.val$}");
|
|
|
|
println!("{val:val$.val$}");
|
|
|
|
println!("{val:val$.val$}");
|
|
|
|
println!("{val:val$.val$}");
|
|
|
|
println!("{val:val$.val$}");
|
|
|
|
println!("{val:val$.val$}");
|
|
|
|
println!("{val:val$.val$}");
|
|
|
|
println!("{width:width$}");
|
|
|
|
println!("{local_i32:width$}");
|
|
|
|
println!("{width:width$}");
|
|
|
|
println!("{local_i32:width$}");
|
|
|
|
println!("{prec:.prec$}");
|
|
|
|
println!("{local_i32:.prec$}");
|
|
|
|
println!("{prec:.prec$}");
|
|
|
|
println!("{local_i32:.prec$}");
|
|
|
|
println!("{width:width$.prec$}");
|
|
|
|
println!("{width:width$.prec$}");
|
|
|
|
println!("{local_f64:width$.prec$}");
|
|
|
|
println!("{local_f64:width$.prec$} {local_f64} {width} {prec}");
|
|
|
|
println!(
|
2022-11-25 09:36:22 -06:00
|
|
|
"{local_i32:width$.prec$} {local_i32:prec$.width$} {width:local_i32$.prec$} {width:prec$.local_i32$} {prec:local_i32$.width$} {prec:width$.local_i32$}",
|
new uninlined_format_args lint to inline explicit arguments
Implement https://github.com/rust-lang/rust-clippy/issues/8368 - a new
lint to inline format arguments such as `print!("{}", var)` into
`print!("{var}")`.
code | suggestion | comment
---|---|---
`print!("{}", var)` | `print!("{var}")` | simple variables
`print!("{0}", var)` | `print!("{var}")` | positional variables
`print!("{v}", v=var)` | `print!("{var}")` | named variables
`print!("{0} {0}", var)` | `print!("{var} {var}")` | aliased variables
`print!("{0:1$}", var, width)` | `print!("{var:width$}")` | width
support
`print!("{0:.1$}", var, prec)` | `print!("{var:.prec$}")` | precision
support
`print!("{:.*}", prec, var)` | `print!("{var:.prec$}")` | asterisk
support
code | suggestion | comment
---|---|---
`print!("{0}={1}", var, 1+2)` | `print!("{var}={0}", 1+2)` | Format
string uses an indexed argument that cannot be inlined. Supporting this
case requires re-indexing of the format string.
changelog: [`uninlined_format_args`]: A new lint to inline format
arguments, i.e. `print!("{}", var)` into `print!("{var}")`
2022-09-14 11:25:48 -05:00
|
|
|
);
|
|
|
|
println!(
|
|
|
|
"{0:1$.2$} {0:2$.1$} {1:0$.2$} {1:2$.0$} {2:0$.1$} {2:1$.0$} {3}",
|
|
|
|
local_i32,
|
|
|
|
width,
|
|
|
|
prec,
|
|
|
|
1 + 2
|
|
|
|
);
|
|
|
|
println!("Width = {local_i32}, value with width = {local_f64:local_i32$}");
|
|
|
|
println!("{local_i32:width$.prec$}");
|
|
|
|
println!("{width:width$.prec$}");
|
2023-03-28 07:22:22 -05:00
|
|
|
println!("{}", format!("{}", local_i32));
|
new uninlined_format_args lint to inline explicit arguments
Implement https://github.com/rust-lang/rust-clippy/issues/8368 - a new
lint to inline format arguments such as `print!("{}", var)` into
`print!("{var}")`.
code | suggestion | comment
---|---|---
`print!("{}", var)` | `print!("{var}")` | simple variables
`print!("{0}", var)` | `print!("{var}")` | positional variables
`print!("{v}", v=var)` | `print!("{var}")` | named variables
`print!("{0} {0}", var)` | `print!("{var} {var}")` | aliased variables
`print!("{0:1$}", var, width)` | `print!("{var:width$}")` | width
support
`print!("{0:.1$}", var, prec)` | `print!("{var:.prec$}")` | precision
support
`print!("{:.*}", prec, var)` | `print!("{var:.prec$}")` | asterisk
support
code | suggestion | comment
---|---|---
`print!("{0}={1}", var, 1+2)` | `print!("{var}={0}", 1+2)` | Format
string uses an indexed argument that cannot be inlined. Supporting this
case requires re-indexing of the format string.
changelog: [`uninlined_format_args`]: A new lint to inline format
arguments, i.e. `print!("{}", var)` into `print!("{var}")`
2022-09-14 11:25:48 -05:00
|
|
|
my_println!("{}", local_i32);
|
|
|
|
my_println_args!("{}", local_i32);
|
|
|
|
|
|
|
|
// these should NOT be modified by the lint
|
|
|
|
println!(concat!("nope ", "{}"), local_i32);
|
|
|
|
println!("val='{local_i32}'");
|
|
|
|
println!("val='{local_i32 }'");
|
|
|
|
println!("val='{local_i32 }'"); // with tab
|
|
|
|
println!("val='{local_i32\n}'");
|
|
|
|
println!("{}", usize::MAX);
|
|
|
|
println!("{}", local_opt.unwrap());
|
|
|
|
println!(
|
|
|
|
"val='{local_i32
|
|
|
|
}'"
|
|
|
|
);
|
|
|
|
println!(no_param_str!(), local_i32);
|
|
|
|
|
2022-10-05 11:10:52 -05:00
|
|
|
println!(
|
2022-11-25 09:36:22 -06:00
|
|
|
"{val}",
|
2022-10-05 11:10:52 -05:00
|
|
|
);
|
|
|
|
println!("{val}");
|
|
|
|
|
|
|
|
println!(with_span!("{0} {1}" "{1} {0}"), local_i32, local_f64);
|
|
|
|
println!("{}", with_span!(span val));
|
2022-10-08 03:49:00 -05:00
|
|
|
|
|
|
|
if local_i32 > 0 {
|
|
|
|
panic!("p1 {local_i32}");
|
|
|
|
}
|
|
|
|
if local_i32 > 0 {
|
|
|
|
panic!("p2 {local_i32}");
|
|
|
|
}
|
|
|
|
if local_i32 > 0 {
|
|
|
|
panic!("p3 {local_i32}");
|
|
|
|
}
|
|
|
|
if local_i32 > 0 {
|
|
|
|
panic!("p4 {local_i32}");
|
|
|
|
}
|
new uninlined_format_args lint to inline explicit arguments
Implement https://github.com/rust-lang/rust-clippy/issues/8368 - a new
lint to inline format arguments such as `print!("{}", var)` into
`print!("{var}")`.
code | suggestion | comment
---|---|---
`print!("{}", var)` | `print!("{var}")` | simple variables
`print!("{0}", var)` | `print!("{var}")` | positional variables
`print!("{v}", v=var)` | `print!("{var}")` | named variables
`print!("{0} {0}", var)` | `print!("{var} {var}")` | aliased variables
`print!("{0:1$}", var, width)` | `print!("{var:width$}")` | width
support
`print!("{0:.1$}", var, prec)` | `print!("{var:.prec$}")` | precision
support
`print!("{:.*}", prec, var)` | `print!("{var:.prec$}")` | asterisk
support
code | suggestion | comment
---|---|---
`print!("{0}={1}", var, 1+2)` | `print!("{var}={0}", 1+2)` | Format
string uses an indexed argument that cannot be inlined. Supporting this
case requires re-indexing of the format string.
changelog: [`uninlined_format_args`]: A new lint to inline format
arguments, i.e. `print!("{}", var)` into `print!("{var}")`
2022-09-14 11:25:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
tester(42);
|
|
|
|
}
|
|
|
|
|
2022-11-19 06:50:02 -06:00
|
|
|
#[clippy::msrv = "1.57"]
|
new uninlined_format_args lint to inline explicit arguments
Implement https://github.com/rust-lang/rust-clippy/issues/8368 - a new
lint to inline format arguments such as `print!("{}", var)` into
`print!("{var}")`.
code | suggestion | comment
---|---|---
`print!("{}", var)` | `print!("{var}")` | simple variables
`print!("{0}", var)` | `print!("{var}")` | positional variables
`print!("{v}", v=var)` | `print!("{var}")` | named variables
`print!("{0} {0}", var)` | `print!("{var} {var}")` | aliased variables
`print!("{0:1$}", var, width)` | `print!("{var:width$}")` | width
support
`print!("{0:.1$}", var, prec)` | `print!("{var:.prec$}")` | precision
support
`print!("{:.*}", prec, var)` | `print!("{var:.prec$}")` | asterisk
support
code | suggestion | comment
---|---|---
`print!("{0}={1}", var, 1+2)` | `print!("{var}={0}", 1+2)` | Format
string uses an indexed argument that cannot be inlined. Supporting this
case requires re-indexing of the format string.
changelog: [`uninlined_format_args`]: A new lint to inline format
arguments, i.e. `print!("{}", var)` into `print!("{var}")`
2022-09-14 11:25:48 -05:00
|
|
|
fn _under_msrv() {
|
|
|
|
let local_i32 = 1;
|
|
|
|
println!("don't expand='{}'", local_i32);
|
|
|
|
}
|
|
|
|
|
2022-11-19 06:50:02 -06:00
|
|
|
#[clippy::msrv = "1.58"]
|
new uninlined_format_args lint to inline explicit arguments
Implement https://github.com/rust-lang/rust-clippy/issues/8368 - a new
lint to inline format arguments such as `print!("{}", var)` into
`print!("{var}")`.
code | suggestion | comment
---|---|---
`print!("{}", var)` | `print!("{var}")` | simple variables
`print!("{0}", var)` | `print!("{var}")` | positional variables
`print!("{v}", v=var)` | `print!("{var}")` | named variables
`print!("{0} {0}", var)` | `print!("{var} {var}")` | aliased variables
`print!("{0:1$}", var, width)` | `print!("{var:width$}")` | width
support
`print!("{0:.1$}", var, prec)` | `print!("{var:.prec$}")` | precision
support
`print!("{:.*}", prec, var)` | `print!("{var:.prec$}")` | asterisk
support
code | suggestion | comment
---|---|---
`print!("{0}={1}", var, 1+2)` | `print!("{var}={0}", 1+2)` | Format
string uses an indexed argument that cannot be inlined. Supporting this
case requires re-indexing of the format string.
changelog: [`uninlined_format_args`]: A new lint to inline format
arguments, i.e. `print!("{}", var)` into `print!("{var}")`
2022-09-14 11:25:48 -05:00
|
|
|
fn _meets_msrv() {
|
|
|
|
let local_i32 = 1;
|
|
|
|
println!("expand='{local_i32}'");
|
|
|
|
}
|
2023-02-13 13:41:26 -06:00
|
|
|
|
|
|
|
fn _do_not_fire() {
|
|
|
|
println!("{:?}", None::<()>);
|
|
|
|
}
|
2023-03-28 19:52:55 -05:00
|
|
|
|
|
|
|
macro_rules! _internal {
|
|
|
|
($($args:tt)*) => {
|
|
|
|
println!("{}", format_args!($($args)*))
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! my_println2 {
|
|
|
|
($target:expr, $($args:tt)+) => {{
|
|
|
|
if $target {
|
|
|
|
_internal!($($args)+)
|
|
|
|
}
|
|
|
|
}};
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! my_println2_args {
|
|
|
|
($target:expr, $($args:tt)+) => {{
|
|
|
|
if $target {
|
|
|
|
_internal!("foo: {}", format_args!($($args)+))
|
|
|
|
}
|
|
|
|
}};
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! my_concat {
|
|
|
|
($fmt:literal $(, $e:expr)*) => {
|
|
|
|
println!(concat!("ERROR: ", $fmt), $($e,)*)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! my_good_macro {
|
|
|
|
($fmt:literal $(, $e:expr)* $(,)?) => {
|
|
|
|
println!($fmt $(, $e)*)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! my_bad_macro {
|
|
|
|
($fmt:literal, $($e:expr),*) => {
|
|
|
|
println!($fmt, $($e,)*)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! my_bad_macro2 {
|
|
|
|
($fmt:literal) => {
|
|
|
|
let s = $fmt.clone();
|
|
|
|
println!("{}", s);
|
|
|
|
};
|
|
|
|
($fmt:literal, $($e:expr)+) => {
|
|
|
|
println!($fmt, $($e,)*)
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
// This abomination was suggested by @Alexendoo, may the Rust gods have mercy on their soul...
|
|
|
|
// https://github.com/rust-lang/rust-clippy/pull/9948#issuecomment-1327965962
|
|
|
|
macro_rules! used_twice {
|
|
|
|
(
|
|
|
|
large = $large:literal,
|
|
|
|
small = $small:literal,
|
|
|
|
$val:expr,
|
|
|
|
) => {
|
|
|
|
if $val < 5 {
|
|
|
|
println!($small, $val);
|
|
|
|
} else {
|
|
|
|
println!($large, $val);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
fn tester2() {
|
|
|
|
let local_i32 = 1;
|
|
|
|
my_println2_args!(true, "{}", local_i32);
|
|
|
|
my_println2!(true, "{}", local_i32);
|
|
|
|
my_concat!("{}", local_i32);
|
|
|
|
my_good_macro!("{}", local_i32);
|
|
|
|
my_good_macro!("{}", local_i32,);
|
|
|
|
|
|
|
|
// FIXME: Broken false positives, currently unhandled
|
|
|
|
my_bad_macro!("{}", local_i32);
|
|
|
|
my_bad_macro2!("{}", local_i32);
|
|
|
|
used_twice! {
|
|
|
|
large = "large value: {}",
|
|
|
|
small = "small value: {}",
|
|
|
|
local_i32,
|
|
|
|
};
|
|
|
|
}
|