about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/back/write.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-11-27 11:31:26 +0000
committerbors <bors@rust-lang.org>2021-11-27 11:31:26 +0000
commit5fd3a5c7c175f228afaf5fc6ff00c177b83d8055 (patch)
tree426581ff89fd3fb3420ab8cdd1a2941d4aa3cca0 /compiler/rustc_codegen_llvm/src/back/write.rs
parent0881b3abe424034b0c69b99632b64b355057f203 (diff)
parent3f9b26dc64a2068d30027fd29ffbbfe07663419f (diff)
downloadrust-5fd3a5c7c175f228afaf5fc6ff00c177b83d8055.tar.gz
rust-5fd3a5c7c175f228afaf5fc6ff00c177b83d8055.zip
Auto merge of #89916 - the8472:advance_by-avoid-err-0, r=dtolnay
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/back/write.rs')
0 files changed, 0 insertions, 0 deletions