about summary refs log tree commit diff
path: root/src/test/codegen/stack-alloc-string-slice.cc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-04-29 00:15:22 +0000
committerbors <bors@rust-lang.org>2015-04-29 00:15:22 +0000
commitc4b23aec4c5ddf32df1e0ba3cc23212327cd8b1f (patch)
tree45cf093827a54610239c2fddd3760b8addf4444d /src/test/codegen/stack-alloc-string-slice.cc
parent8871c17b76a1e0ab36ce2bb51008b53f596e5b3c (diff)
parent95be21df477655131627def1943de73922b1f6a4 (diff)
downloadrust-c4b23aec4c5ddf32df1e0ba3cc23212327cd8b1f.tar.gz
rust-c4b23aec4c5ddf32df1e0ba3cc23212327cd8b1f.zip
Auto merge of #24865 - bluss:range-size, r=alexcrichton
core: Fix size_hint for signed integer `Range<T>` iterators

There was an overflow bug in .size_hint() for signed iterators, which
produced an hilariously incorrect size or an overflow panic.

Incorrect size is a serious bug since the iterators are marked
ExactSizeIterator. (And leads to abort() on (-1i8..127).collect() when
the collection tries to preallocate too much).

> (-1i8..127).size_hint()
(18446744073709551488, Some(18446744073709551488))

Bug found using quickcheck.

Fixes #24851
Diffstat (limited to 'src/test/codegen/stack-alloc-string-slice.cc')
0 files changed, 0 insertions, 0 deletions