about summary refs log tree commit diff
path: root/src/libsyntax/errors
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-08-26 00:27:00 +0000
committerbors <bors@rust-lang.org>2015-08-26 00:27:00 +0000
commitef3255b063a28ef1ed8346192325cfac66398739 (patch)
tree67a26718b02c4bf22d79fa7a2d0e4390e8129d72 /src/libsyntax/errors
parent14b7591ee578042da43f6a9968034f4998cf291c (diff)
parent35eb3e8b79c60ec18e724c7a68625d7cdf9300c0 (diff)
downloadrust-ef3255b063a28ef1ed8346192325cfac66398739.tar.gz
rust-ef3255b063a28ef1ed8346192325cfac66398739.zip
Auto merge of #27991 - bluss:chain-rev, r=alexcrichton
Correct iterator adaptor Chain

The iterator protocol specifies that the iteration ends with the return
value `None` from `.next()` (or `.next_back()`) and it is unspecified
what further calls return. The chain adaptor must account for this in
its DoubleEndedIterator implementation.

It uses three states:

- Both `a` and `b` are valid
- Only the Front iterator (`a`) is valid
- Only the Back iterator (`b`) is valid

The fourth state (neither iterator is valid) only occurs after Chain has
returned None once, so we don't need to store this state.

Fixes #26316
Diffstat (limited to 'src/libsyntax/errors')
0 files changed, 0 insertions, 0 deletions