2016-11-11 15:23:15 +11:00
|
|
|
fn main() {
|
2018-01-15 21:38:12 -08:00
|
|
|
println!("%.*3$s %s!\n", "Hello,", "World", 4); //~ ERROR multiple unused formatting arguments
|
2017-11-20 13:13:27 +01:00
|
|
|
println!("%1$*2$.*3$f", 123.456); //~ ERROR never used
|
2018-07-24 16:01:38 -07: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-11 15:23:15 +11: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 13:13:27 +01:00
|
|
|
println!("{} %f", "one", 2.0); //~ ERROR never used
|
2016-11-11 15:23:15 +11:00
|
|
|
|
2017-11-20 13:13:27 +01:00
|
|
|
println!("Hi there, $NAME.", NAME="Tim"); //~ ERROR never used
|
2018-07-30 16:33:53 -07:00
|
|
|
println!("$1 $0 $$ $NAME", 1, 2, NAME=3);
|
|
|
|
//~^ ERROR multiple unused formatting arguments
|
2016-11-11 15:23:15 +11:00
|
|
|
}
|