about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorThe8472 <git@infinite-source.de>2021-10-14 12:10:18 +0200
committerThe8472 <git@infinite-source.de>2021-11-19 13:00:23 +0100
commit3f9b26dc64a2068d30027fd29ffbbfe07663419f (patch)
tree789ec818eeb3d78cf2c901ddf2c430daeb5f0152 /compiler/rustc_codegen_llvm/src
parentcc946fcd326f7d85d4af096efdc73538622568e9 (diff)
downloadrust-3f9b26dc64a2068d30027fd29ffbbfe07663419f.tar.gz
rust-3f9b26dc64a2068d30027fd29ffbbfe07663419f.zip
Fix Iterator::advance_by contract inconsistency
The `advance_by(n)` docs state that in the error case `Err(k)` that k is always less than n.
It also states that `advance_by(0)` may return `Err(0)` to indicate an exhausted iterator.
These statements are inconsistent.
Since only one implementation (Skip) actually made use of that I changed it to return Ok(()) in that case too.

While adding some tests I also found a bug in `Take::advance_back_by`.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions