Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't fuse Chain in its second iterator #71404

Merged
merged 1 commit into from
Apr 23, 2020
Merged

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Apr 21, 2020

Only the "first" iterator is actually set None when exhausted,
depending on whether you iterate forward or backward. This restores
behavior similar to the former ChainState, where it would transition
from Both to Front/Back and only continue from that side.

However, if you mix directions, then this may still set both sides to
None, totally fusing the iterator.

Fixes #71375
r? @scottmcm

Only the "first" iterator is actually set `None` when exhausted,
depending on whether you iterate forward or backward. This restores
behavior similar to the former `ChainState`, where it would transition
from `Both` to `Front`/`Back` and only continue from that side.

However, if you mix directions, then this may still set both sides to
`None`, totally fusing the iterator.
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 21, 2020
@scottmcm
Copy link
Member

I like this. Certainly seems justifiable to "don't write a None if you don't have to".

@bors r+

I see this is marked as a beta regression; what's the process for contemplating that?

@bors
Copy link
Contributor

bors commented Apr 22, 2020

📌 Commit eeb687f has been approved by scottmcm

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 22, 2020
@scottmcm scottmcm added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 22, 2020
@cuviper cuviper added I-nominated T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Apr 22, 2020
@cuviper
Copy link
Member Author

cuviper commented Apr 22, 2020

I see this is marked as a beta regression; what's the process for contemplating that?

Needs T- and I-nominated labels to get them to look at it, which I added. For reference:
https://forge.rust-lang.org/release/beta-backporting.html#backporting-in-rust-langrust

@Mark-Simulacrum
Copy link
Member

Cc @rust-lang/libs on backport approval

@dtolnay
Copy link
Member

dtolnay commented Apr 23, 2020

Looks okay to backport.

Is this regressed in 1.43 or 1.44? #71375 only says it worked in 1.42 and is broken in nightly (1.44).

@cuviper
Copy link
Member Author

cuviper commented Apr 23, 2020

Is this regressed in 1.43 or 1.44? #71375 only says it worked in 1.42 and is broken in nightly (1.44).

The changed behavior is from #70896, which will ship in 1.44. That was nightly when reported, but that just branched into beta.

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 23, 2020
Rollup of 7 pull requests

Successful merges:

 - rust-lang#70633 (Confusing suggestion on incorrect closing `}`)
 - rust-lang#71404 (Don't fuse Chain in its second iterator)
 - rust-lang#71408 (Check code blocks tags)
 - rust-lang#71442 (Add a "by reference" adaptor for `AllocRef`)
 - rust-lang#71446 (Only use read_unaligned in transmute_copy if necessary)
 - rust-lang#71470 (Fix doc links)
 - rust-lang#71479 (add back Scalar::null_ptr)

Failed merges:

r? @ghost
@bors bors merged commit 2a1cd44 into rust-lang:master Apr 23, 2020
@Mark-Simulacrum Mark-Simulacrum added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Apr 30, 2020
@Mark-Simulacrum
Copy link
Member

Accepting for beta backport per #71404 (comment)

@Mark-Simulacrum Mark-Simulacrum removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label May 9, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request May 11, 2020
…ulacrum

[beta] backports

This backport rollup includes the following:
 * [beta] Update cargo rust-lang#71967
 * Backport 1.43.1 release notes to master rust-lang#71914
 * Update the `cc` crate rust-lang#71882
 * resolve: Relax fresh binding disambiguation slightly to fix regression rust-lang#71846
 * Do not try to find binop method on RHS `TyErr` rust-lang#71810
 * Quick and dirty fix of the unused_braces lint rust-lang#71517
 * Update stdarch submodule rust-lang#71495
 * normalize field projection ty to fix broken MIR issue rust-lang#71488
 * Update openssl-src to 1.1.1g rust-lang#71430
 * fix error code in E0751.md rust-lang#71426
 * Don't fuse Chain in its second iterator rust-lang#71404
 * Remove some `Vec` allocations to improve performance rust-lang#71268
 * [CI] Use the latest Python available on Windows rust-lang#71995

It also switches the bootstrap compiler to 1.43.1.
@cuviper cuviper deleted the chain-unfused branch May 30, 2020 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chain iterator adapter changed behavior in nightly
6 participants