about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-04-11 15:34:24 +0000
committerbors <bors@rust-lang.org>2015-04-11 15:34:24 +0000
commit67a8f61730418768f07d8ed0f9735a31d0c5d84d (patch)
tree766fd249b394c2a1befc63b6da02e0e306ad9b23 /src/libstd/sys/unix/stack_overflow.rs
parentacb3e5136c3ca0a0d27150136fa7ffecbee75b92 (diff)
parentfaef52a847acc0dfe1e15117fe3201731209a95d (diff)
downloadrust-67a8f61730418768f07d8ed0f9735a31d0c5d84d.tar.gz
rust-67a8f61730418768f07d8ed0f9735a31d0c5d84d.zip
Auto merge of #24269 - benashford:formatting-fix, r=alexcrichton
This fixes the bug described in issue #23150.  This affected formatting any floating point number into a string in a formatting pattern that: a) required rounding up, and b) required an extra digit on the front.

So `format!("{:.0}", 9.9)` would fail, but `format!("{:.0}", 8.9)` would succeed.  This was due to a negative integer being cast to a `usize` resulting in an 'arithmetic operation overflowed' panic.

The fix was to change the order of operations so that the number is zero before casting.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions