about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser/expr.rs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-10-23 17:32:33 -0700
committerEsteban Küber <esteban@kuber.com.ar>2019-10-23 17:32:33 -0700
commit8467ceff22477fe567883e6fbd810e0f9e220686 (patch)
treed302064b010d4a5698efea38ec1071c5f06c828b /src/libsyntax/parse/parser/expr.rs
parent4a8c5b20c7772bc5342b83d4b0696ea216ef75a7 (diff)
downloadrust-8467ceff22477fe567883e6fbd810e0f9e220686.tar.gz
rust-8467ceff22477fe567883e6fbd810e0f9e220686.zip
Tweak format string error to point at arguments always
Add secondary span labels with no text to make it clear when there's a
mismatch bewteen the positional arguments in a format string and the
arguments to the macro. This shouldn't affect experienced users, but it
should make it easier for newcomers to more clearly understand how
`format!()` and `println!()` are supposed to be used.

```
error: 2 positional arguments in format string, but there is 1 argument
 --> file8.rs:2:14
  |
2 |     format!("{} {}", 1);
  |              ^^ ^^   -
```

instead of

```
error: 2 positional arguments in format string, but there is 1 argument
 --> file8.rs:2:14
  |
2 |     format!("{} {}", 1);
  |              ^^ ^^
```
Diffstat (limited to 'src/libsyntax/parse/parser/expr.rs')
0 files changed, 0 insertions, 0 deletions