about summary refs log tree commit diff
path: root/src/test/ui/iterators/iter-sum-overflow-debug.rs
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-10-24 20:20:05 +0200
committerGitHub <noreply@github.com>2019-10-24 20:20:05 +0200
commit1e4a2ee6d5b7b353d5d0956882dabc89c15ecbb6 (patch)
treee1f72da4abf9d64687cff291b6c126b16e4c41cf /src/test/ui/iterators/iter-sum-overflow-debug.rs
parentefa50378d592b8fdc0eeb8ac48a453e0f1babacf (diff)
parent8467ceff22477fe567883e6fbd810e0f9e220686 (diff)
downloadrust-1e4a2ee6d5b7b353d5d0956882dabc89c15ecbb6.tar.gz
rust-1e4a2ee6d5b7b353d5d0956882dabc89c15ecbb6.zip
Rollup merge of #65746 - estebank:newcomer-format, r=Centril
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);
  |              ^^ ^^
```

r? @Centril
Diffstat (limited to 'src/test/ui/iterators/iter-sum-overflow-debug.rs')
0 files changed, 0 insertions, 0 deletions