refactor RangeFromIter overflow-checks impl#154191
Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom Mar 23, 2026
Merged
refactor RangeFromIter overflow-checks impl#154191rust-bors[bot] merged 1 commit intorust-lang:mainfrom
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Conversation
Collaborator
|
|
tgross35
reviewed
Mar 22, 2026
Comment on lines
+27
to
+40
|
|
||
| // let a_next_ocno = next_ocno(&mut a.clone()); | ||
| // let a_next_ocyes = next_ocyes(&mut a); | ||
| // let b_next_ocyes = next_ocyes(&mut b.clone()); | ||
| // let b_next_ocno = next_ocno(&mut b); | ||
|
|
||
| // assert_eq!(n, a_next_ocno); | ||
| // assert_eq!(a_next_ocno, a_next_ocyes); | ||
| // assert_eq!(n, b_next_ocyes); | ||
| // assert_eq!(b_next_ocyes, b_next_ocno); | ||
|
|
||
|
|
||
| // assert_eq!(next_ocno(&mut a.clone()), next_ocyes(&mut a)); | ||
| // assert_eq!(next_ocyes(&mut b.clone()), next_ocno(&mut b)); |
Contributor
Author
There was a problem hiding this comment.
Knew I was going to forget about this 🤦♂️
Comment on lines
+43
to
+50
| // `b` should have wrapped | ||
| assert_eq!(0, next_ocyes(&mut b.clone())); | ||
| assert_eq!(0, next_ocno(&mut b)); | ||
| // `a` should be exhausted, | ||
| // which will wrap when called without overflow-checks | ||
| assert_eq!(0, next_ocno(&mut a.clone())); | ||
| // and panic when called with overflow-checks | ||
| let r = std::panic::catch_unwind(move || { |
Contributor
There was a problem hiding this comment.
(optional nit) Maybe give a and b names like next_with_oc and next_without_oc? It's a bit tricky to follow
Contributor
|
Checking what I said in #154191 (comment) @bors try jobs=x86_64-gnu-nopt Cc issue author @theemathas |
Contributor
|
⌛ Trying commit e173b53 with merge e81a45d… To cancel the try build, run the command Workflow: https://github.com/rust-lang/rust/actions/runs/23408886027 |
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 22, 2026
refactor RangeFromIter overflow-checks impl try-job: x86_64-gnu-nopt
Contributor
|
@bors try cancel |
Contributor
|
Try build cancelled. Cancelled workflows: |
tgross35
approved these changes
Mar 22, 2026
Crates with different overflow-checks settings accessing the same RangeFromIter resulted in incorrect values being yielded
Contributor
|
@bors r+ |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Mar 23, 2026
refactor RangeFromIter overflow-checks impl Crates with different overflow-checks settings accessing the same RangeFromIter resulted in incorrect values being yielded Fixes rust-lang#154124 r? @tgross35
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Mar 23, 2026
refactor RangeFromIter overflow-checks impl Crates with different overflow-checks settings accessing the same RangeFromIter resulted in incorrect values being yielded Fixes rust-lang#154124 r? @tgross35
This was referenced Mar 23, 2026
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 23, 2026
…uwer Rollup of 13 pull requests Successful merges: - #154241 (`rust-analyzer` subtree update) - #153686 (`std`: include `dlmalloc` for all non-wasi Wasm targets) - #154105 (bootstrap: Pass `--features=rustc` to rustc_transmute) - #153069 ([BPF] add target feature allows-misaligned-mem-access) - #154085 (Parenthesize or-patterns in prefix pattern positions in pretty printer) - #154191 (refactor RangeFromIter overflow-checks impl) - #154207 (Refactor query loading) - #153540 (drop derive helpers during attribute parsing) - #154140 (Document consteval behavior of ub_checks, overflow_checks, is_val_statically_known.) - #154161 (On E0277 tweak help when single type impls traits) - #154218 (interpret/validity: remove unreachable error kind) - #154225 (diagnostics: avoid ICE in confusable_method_name for associated functions) - #154228 (Improve inline assembly error messages)
github-actions bot
pushed a commit
to rust-lang/stdarch
that referenced
this pull request
Mar 26, 2026
…uwer Rollup of 13 pull requests Successful merges: - rust-lang/rust#154241 (`rust-analyzer` subtree update) - rust-lang/rust#153686 (`std`: include `dlmalloc` for all non-wasi Wasm targets) - rust-lang/rust#154105 (bootstrap: Pass `--features=rustc` to rustc_transmute) - rust-lang/rust#153069 ([BPF] add target feature allows-misaligned-mem-access) - rust-lang/rust#154085 (Parenthesize or-patterns in prefix pattern positions in pretty printer) - rust-lang/rust#154191 (refactor RangeFromIter overflow-checks impl) - rust-lang/rust#154207 (Refactor query loading) - rust-lang/rust#153540 (drop derive helpers during attribute parsing) - rust-lang/rust#154140 (Document consteval behavior of ub_checks, overflow_checks, is_val_statically_known.) - rust-lang/rust#154161 (On E0277 tweak help when single type impls traits) - rust-lang/rust#154218 (interpret/validity: remove unreachable error kind) - rust-lang/rust#154225 (diagnostics: avoid ICE in confusable_method_name for associated functions) - rust-lang/rust#154228 (Improve inline assembly error messages)
github-actions bot
pushed a commit
to rust-lang/rust-analyzer
that referenced
this pull request
Mar 26, 2026
…uwer Rollup of 13 pull requests Successful merges: - rust-lang/rust#154241 (`rust-analyzer` subtree update) - rust-lang/rust#153686 (`std`: include `dlmalloc` for all non-wasi Wasm targets) - rust-lang/rust#154105 (bootstrap: Pass `--features=rustc` to rustc_transmute) - rust-lang/rust#153069 ([BPF] add target feature allows-misaligned-mem-access) - rust-lang/rust#154085 (Parenthesize or-patterns in prefix pattern positions in pretty printer) - rust-lang/rust#154191 (refactor RangeFromIter overflow-checks impl) - rust-lang/rust#154207 (Refactor query loading) - rust-lang/rust#153540 (drop derive helpers during attribute parsing) - rust-lang/rust#154140 (Document consteval behavior of ub_checks, overflow_checks, is_val_statically_known.) - rust-lang/rust#154161 (On E0277 tweak help when single type impls traits) - rust-lang/rust#154218 (interpret/validity: remove unreachable error kind) - rust-lang/rust#154225 (diagnostics: avoid ICE in confusable_method_name for associated functions) - rust-lang/rust#154228 (Improve inline assembly error messages)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Crates with different overflow-checks settings accessing the same RangeFromIter resulted in incorrect values being yielded
Fixes #154124
r? @tgross35