|
| 1 | +error: 1 positional argument in format string, but no arguments were given |
| 2 | + --> $DIR/ifmt-bad-arg.rs:16:14 |
| 3 | + | |
| 4 | +LL | format!("{}"); |
| 5 | + | ^^ |
| 6 | + |
| 7 | +error: invalid reference to positional argument 1 (there is 1 argument) |
| 8 | + --> $DIR/ifmt-bad-arg.rs:19:14 |
| 9 | + | |
| 10 | +LL | format!("{1}", 1); |
| 11 | + | ^^^ |
| 12 | + | |
| 13 | + = note: positional arguments are zero-based |
| 14 | + |
| 15 | +error: argument never used |
| 16 | + --> $DIR/ifmt-bad-arg.rs:19:20 |
| 17 | + | |
| 18 | +LL | format!("{1}", 1); |
| 19 | + | ^ |
| 20 | + |
| 21 | +error: 2 positional arguments in format string, but no arguments were given |
| 22 | + --> $DIR/ifmt-bad-arg.rs:23:14 |
| 23 | + | |
| 24 | +LL | format!("{} {}"); |
| 25 | + | ^^ ^^ |
| 26 | + |
| 27 | +error: invalid reference to positional argument 1 (there is 1 argument) |
| 28 | + --> $DIR/ifmt-bad-arg.rs:26:14 |
| 29 | + | |
| 30 | +LL | format!("{0} {1}", 1); |
| 31 | + | ^^^ ^^^ |
| 32 | + | |
| 33 | + = note: positional arguments are zero-based |
| 34 | + |
| 35 | +error: invalid reference to positional argument 2 (there are 2 arguments) |
| 36 | + --> $DIR/ifmt-bad-arg.rs:29:14 |
| 37 | + | |
| 38 | +LL | format!("{0} {1} {2}", 1, 2); |
| 39 | + | ^^^ ^^^ ^^^ |
| 40 | + | |
| 41 | + = note: positional arguments are zero-based |
| 42 | + |
| 43 | +error: invalid reference to positional argument 2 (there are 2 arguments) |
| 44 | + --> $DIR/ifmt-bad-arg.rs:32:14 |
| 45 | + | |
| 46 | +LL | format!("{} {value} {} {}", 1, value=2); |
| 47 | + | ^^ ^^^^^^^ ^^ ^^ |
| 48 | + | |
| 49 | + = note: positional arguments are zero-based |
| 50 | + |
| 51 | +error: invalid reference to positional arguments 3, 4 and 5 (there are 3 arguments) |
| 52 | + --> $DIR/ifmt-bad-arg.rs:34:14 |
| 53 | + | |
| 54 | +LL | format!("{name} {value} {} {} {} {} {} {}", 0, name=1, value=2); |
| 55 | + | ^^^^^^ ^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ |
| 56 | + | |
| 57 | + = note: positional arguments are zero-based |
| 58 | + |
| 59 | +error: there is no argument named `foo` |
| 60 | + --> $DIR/ifmt-bad-arg.rs:37:13 |
| 61 | + | |
| 62 | +LL | format!("{} {foo} {} {bar} {}", 1, 2, 3); |
| 63 | + | ^^^^^^^^^^^^^^^^^^^^^^ |
| 64 | + |
| 65 | +error: there is no argument named `bar` |
| 66 | + --> $DIR/ifmt-bad-arg.rs:37:13 |
| 67 | + | |
| 68 | +LL | format!("{} {foo} {} {bar} {}", 1, 2, 3); |
| 69 | + | ^^^^^^^^^^^^^^^^^^^^^^ |
| 70 | + |
| 71 | +error: there is no argument named `foo` |
| 72 | + --> $DIR/ifmt-bad-arg.rs:41:13 |
| 73 | + | |
| 74 | +LL | format!("{foo}"); //~ ERROR: no argument named `foo` |
| 75 | + | ^^^^^^^ |
| 76 | + |
| 77 | +error: multiple unused formatting arguments |
| 78 | + --> $DIR/ifmt-bad-arg.rs:42:17 |
| 79 | + | |
| 80 | +LL | format!("", 1, 2); //~ ERROR: multiple unused formatting arguments |
| 81 | + | -- ^ ^ |
| 82 | + | | |
| 83 | + | multiple missing formatting arguments |
| 84 | + |
| 85 | +error: argument never used |
| 86 | + --> $DIR/ifmt-bad-arg.rs:43:22 |
| 87 | + | |
| 88 | +LL | format!("{}", 1, 2); //~ ERROR: argument never used |
| 89 | + | ^ |
| 90 | + |
| 91 | +error: argument never used |
| 92 | + --> $DIR/ifmt-bad-arg.rs:44:20 |
| 93 | + | |
| 94 | +LL | format!("{1}", 1, 2); //~ ERROR: argument never used |
| 95 | + | ^ |
| 96 | + |
| 97 | +error: named argument never used |
| 98 | + --> $DIR/ifmt-bad-arg.rs:45:26 |
| 99 | + | |
| 100 | +LL | format!("{}", 1, foo=2); //~ ERROR: named argument never used |
| 101 | + | ^ |
| 102 | + |
| 103 | +error: argument never used |
| 104 | + --> $DIR/ifmt-bad-arg.rs:46:22 |
| 105 | + | |
| 106 | +LL | format!("{foo}", 1, foo=2); //~ ERROR: argument never used |
| 107 | + | ^ |
| 108 | + |
| 109 | +error: named argument never used |
| 110 | + --> $DIR/ifmt-bad-arg.rs:47:21 |
| 111 | + | |
| 112 | +LL | format!("", foo=2); //~ ERROR: named argument never used |
| 113 | + | ^ |
| 114 | + |
| 115 | +error: multiple unused formatting arguments |
| 116 | + --> $DIR/ifmt-bad-arg.rs:48:32 |
| 117 | + | |
| 118 | +LL | format!("{} {}", 1, 2, foo=1, bar=2); //~ ERROR: multiple unused formatting arguments |
| 119 | + | ------- ^ ^ |
| 120 | + | | |
| 121 | + | multiple missing formatting arguments |
| 122 | + |
| 123 | +error: duplicate argument named `foo` |
| 124 | + --> $DIR/ifmt-bad-arg.rs:50:33 |
| 125 | + | |
| 126 | +LL | format!("{foo}", foo=1, foo=2); //~ ERROR: duplicate argument |
| 127 | + | ^ |
| 128 | + | |
| 129 | +note: previously here |
| 130 | + --> $DIR/ifmt-bad-arg.rs:50:26 |
| 131 | + | |
| 132 | +LL | format!("{foo}", foo=1, foo=2); //~ ERROR: duplicate argument |
| 133 | + | ^ |
| 134 | + |
| 135 | +error: expected ident, positional arguments cannot follow named arguments |
| 136 | + --> $DIR/ifmt-bad-arg.rs:51:24 |
| 137 | + | |
| 138 | +LL | format!("", foo=1, 2); //~ ERROR: positional arguments cannot follow |
| 139 | + | ^ |
| 140 | + |
| 141 | +error: there is no argument named `valueb` |
| 142 | + --> $DIR/ifmt-bad-arg.rs:55:13 |
| 143 | + | |
| 144 | +LL | format!("{valuea} {valueb}", valuea=5, valuec=7); |
| 145 | + | ^^^^^^^^^^^^^^^^^^^ |
| 146 | + |
| 147 | +error: named argument never used |
| 148 | + --> $DIR/ifmt-bad-arg.rs:55:51 |
| 149 | + | |
| 150 | +LL | format!("{valuea} {valueb}", valuea=5, valuec=7); |
| 151 | + | ^ |
| 152 | + |
| 153 | +error: invalid format string: expected `'}'` but string was terminated |
| 154 | + --> $DIR/ifmt-bad-arg.rs:61:15 |
| 155 | + | |
| 156 | +LL | format!("{"); //~ ERROR: expected `'}'` but string was terminated |
| 157 | + | ^ expected `'}'` in format string |
| 158 | + | |
| 159 | + = note: if you intended to print `{`, you can escape it using `{{` |
| 160 | + |
| 161 | +error: invalid format string: unmatched `}` found |
| 162 | + --> $DIR/ifmt-bad-arg.rs:63:18 |
| 163 | + | |
| 164 | +LL | format!("foo } bar"); //~ ERROR: unmatched `}` found |
| 165 | + | ^ unmatched `}` in format string |
| 166 | + | |
| 167 | + = note: if you intended to print `}`, you can escape it using `}}` |
| 168 | + |
| 169 | +error: invalid format string: unmatched `}` found |
| 170 | + --> $DIR/ifmt-bad-arg.rs:64:18 |
| 171 | + | |
| 172 | +LL | format!("foo }"); //~ ERROR: unmatched `}` found |
| 173 | + | ^ unmatched `}` in format string |
| 174 | + | |
| 175 | + = note: if you intended to print `}`, you can escape it using `}}` |
| 176 | + |
| 177 | +error: argument never used |
| 178 | + --> $DIR/ifmt-bad-arg.rs:66:27 |
| 179 | + | |
| 180 | +LL | format!("foo %s baz", "bar"); //~ ERROR: argument never used |
| 181 | + | ^^^^^ |
| 182 | + | |
| 183 | + = help: `%s` should be written as `{}` |
| 184 | + = note: printf formatting not supported; see the documentation for `std::fmt` |
| 185 | + |
| 186 | +error: aborting due to 26 previous errors |
| 187 | + |
0 commit comments