about summary refs log tree commit diff
path: root/src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-09-16 05:16:19 +0000
committerbors <bors@rust-lang.org>2019-09-16 05:16:19 +0000
commitb6269f27d99d7da9e95f0b3fdc53193dc8c42fbe (patch)
tree9a11fab56a17cb152d54aeda40332d5e54191434 /src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs
parent3e3e06dfdd2a5c601ae69be7558c1a9fbf4f32d8 (diff)
parent4333b869729bd00b8703721e206249b237a25e72 (diff)
downloadrust-b6269f27d99d7da9e95f0b3fdc53193dc8c42fbe.tar.gz
rust-b6269f27d99d7da9e95f0b3fdc53193dc8c42fbe.zip
Auto merge of #64383 - pcpthm:btreeset-size-hint, r=dtolnay
Improve BTreeSet::Intersection::size_hint

A comment on `IntersectionInner` mentions `small_iter` should be smaller than `other_iter` but this condition is broken while iterating because those two iterators can be consumed at a different rate. I added a test to demonstrate this situation.
<del>I made `small_iter.len() < other_iter.len()` always true by swapping two iterators when that condition became false. This change affects the return value of `size_hint`. The previous result was also correct but this new version always returns smaller upper bound than the previous version.</del>
I changed `size_hint` to taking minimum of both lengths of iterators and renamed fields to `a` and `b` to match `Union` iterator.
Diffstat (limited to 'src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs')
0 files changed, 0 insertions, 0 deletions