diff options
| author | The8472 <git@infinite-source.de> | 2021-10-14 12:10:18 +0200 |
|---|---|---|
| committer | The8472 <git@infinite-source.de> | 2021-11-19 13:00:23 +0100 |
| commit | 3f9b26dc64a2068d30027fd29ffbbfe07663419f (patch) | |
| tree | 789ec818eeb3d78cf2c901ddf2c430daeb5f0152 /compiler/rustc_codegen_llvm/src | |
| parent | cc946fcd326f7d85d4af096efdc73538622568e9 (diff) | |
| download | rust-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
