2016-11-10 22:23:15 -06:00
|
|
|
fn main() {
|
2018-01-15 23:38:12 -06:00
|
|
|
println!("%.*3$s %s!\n", "Hello,", "World", 4); //~ ERROR multiple unused formatting arguments
|
2017-11-20 06:13:27 -06:00
|
|
|
println!("%1$*2$.*3$f", 123.456); //~ ERROR never used
|
2018-07-24 18:01:38 -05:00
|
|
|
println!(r###"%.*3$s
|
|
|
|
%s!\n
|
|
|
|
"###, "Hello,", "World", 4);
|
|
|
|
//~^ ERROR multiple unused formatting arguments
|
|
|
|
// correctly account for raw strings in inline suggestions
|
2016-11-10 22:23:15 -06:00
|
|
|
|
|
|
|
// This should *not* produce hints, on the basis that there's equally as
|
|
|
|
// many "correct" format specifiers. It's *probably* just an actual typo.
|
2017-11-20 06:13:27 -06:00
|
|
|
println!("{} %f", "one", 2.0); //~ ERROR never used
|
2016-11-10 22:23:15 -06:00
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
println!("Hi there, $NAME.", NAME="Tim"); //~ ERROR never used
|
2018-07-30 18:33:53 -05:00
|
|
|
println!("$1 $0 $$ $NAME", 1, 2, NAME=3);
|
|
|
|
//~^ ERROR multiple unused formatting arguments
|
2016-11-10 22:23:15 -06:00
|
|
|
}
|