rust/tests/ui/macros/format-foreign.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
734 B
Rust
Raw Normal View History

fn main() {
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
// 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
2017-11-20 06:13:27 -06:00
println!("Hi there, $NAME.", NAME="Tim"); //~ ERROR never used
println!("$1 $0 $$ $NAME", 1, 2, NAME=3);
//~^ ERROR multiple unused formatting arguments
}