]> git.lizzy.rs Git - rust.git/blob - tests/ui/fmt/issue-89173.rs
Rollup merge of #106715 - BoxyUwU:new_solver_triagebot, r=lcnr
[rust.git] / tests / 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 is not supported
14 }