]> git.lizzy.rs Git - rust.git/blob - src/test/ui/fmt/issue-89173.rs
Auto merge of #95454 - randomicon00:fix95444, r=wesleywiser
[rust.git] / src / test / ui / fmt / issue-89173.rs
1 // Regression test for #89173: Make sure a helpful note is issued for
2 // printf-style format strings using `*` to specify the width.
3
4 fn main() {
5     let num = 0x0abcde;
6     let width = 6;
7     print!("%0*x", width, num);
8     //~^ ERROR: multiple unused formatting arguments
9     //~| NOTE: multiple missing formatting specifiers
10     //~| NOTE: argument never used
11     //~| NOTE: argument never used
12     //~| NOTE: format specifiers use curly braces, and you have to use a positional or named parameter for the width
13     //~| NOTE: printf formatting not supported
14 }