diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-03-19 20:51:06 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-03-19 20:51:06 -0400 |
| commit | e5221f93977922090b0370aff1efdbf5c2d12f6d (patch) | |
| tree | 353e8ce406ecf31f1ab5c42ef7548c238bbaf941 /src/test/run-pass/thinlto | |
| parent | 6eb9960d3603aadab62b8f0877e87c63f67001d6 (diff) | |
| parent | 80654862831e27f249f05bcb50552510f1b5f643 (diff) | |
| download | rust-e5221f93977922090b0370aff1efdbf5c2d12f6d.tar.gz rust-e5221f93977922090b0370aff1efdbf5c2d12f6d.zip | |
Rollup merge of #40241 - Sawyer47:fix-39997, r=alexcrichton
Change how the `0` flag works in format!
Now it always implies right-alignment, so that padding zeroes are placed after the sign (if any) and before the digits. In other words, it always takes precedence over explicitly specified `[[fill]align]`. This also affects the '#' flag: zeroes are placed after the prefix (0b, 0o, 0x) and before the digits.
Here's a short summary of how similar format strings work in Python and Rust:
```
:05 :<05 :>05 :^05
Python 3.6 |-0001| |-1000| |000-1| |0-100|
Rust before |-0001| |-1000| |-0001| |-0100|
Rust after |-0001| |-0001| |-0001| |-0001|
:#05x :<#05x :>#05x :^#05x
Python 3.6 |0x001| |0x100| |000x1| |00x10|
Rust before |0x001| |0x100| |000x1| |0x010|
Rust after |0x001| |0x001| |0x001| |0x001|
```
Fixes #39997 [breaking-change]
Diffstat (limited to 'src/test/run-pass/thinlto')
0 files changed, 0 insertions, 0 deletions
