diff options
| author | Daniel Keep <daniel.keep@gmail.com> | 2016-11-11 15:23:15 +1100 |
|---|---|---|
| committer | Daniel Keep <daniel.keep@gmail.com> | 2016-11-11 15:23:15 +1100 |
| commit | 455723c638b0e9db34d427a82bc13f95b75a304d (patch) | |
| tree | 92631174b5b229513acf2e720f5ec6377359a99a /src/test/incremental/thinlto | |
| parent | e96b9d2bb48b7a886a4d2b9df716265af5d15646 (diff) | |
| download | rust-455723c638b0e9db34d427a82bc13f95b75a304d.tar.gz rust-455723c638b0e9db34d427a82bc13f95b75a304d.zip | |
Add foreign formatting directive detection.
This teaches `format_args!` how to interpret format printf- and
shell-style format directives. This is used in cases where there are
unused formatting arguments, and the reason for that *might* be because
the programmer is trying to use the wrong kind of formatting string.
This was prompted by an issue encountered by simulacrum on the #rust IRC
channel. In short: although `println!` told them that they weren't using
all of the conversion arguments, the problem was in using printf-syle
directives rather than ones `println!` would undertand.
Where possible, `format_args!` will tell the programmer what they should
use instead. For example, it will suggest replacing `%05d` with `{:0>5}`,
or `%2$.*3$s` with `{1:.3$}`. Even if it cannot suggest a replacement,
it will explicitly note that Rust does not support that style of directive,
and direct the user to the `std::fmt` documentation.
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions
