fix Zip unsoundness (again) by the8472 · Pull Request #141076 · rust-lang/rust

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-libs

Relevant to the library team, which will review and decide on the PR/issue.

labels

May 16, 2025

workingjubilee

@rustbot rustbot added S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Jun 3, 2025
Some history: The Zip TrustedRandomAccess specialization has tried
to emulate the side-effects of the naive implementation for a long time,
including backwards iteration. 82292¹ tried to fix unsoundness (82291¹) in that
side-effect-preservation code, but this introduced some panic-safety
unsoundness (86443¹), but the fix 86452¹ didn't fix it for nested Zip
iterators (137255¹).

Rather than piling yet another fix ontop of this heap of fixes this PR reduces
the number of cases in which side-effects will be preserved; the necessary
API guarantee change was approved in 83791¹ but we haven't made use of that
so far.

¹ see merge commit for linkfied issues.

@the8472

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

and removed S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Jun 4, 2025

workingjubilee

@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

Jul 18, 2025

bors added a commit that referenced this pull request

Jul 19, 2025
Rollup of 10 pull requests

Successful merges:

 - #141076 (fix Zip unsoundness (again))
 - #142444 (adding run-make test to autodiff)
 - #143704 (Be a bit more careful around exotic cycles in in the inliner)
 - #144073 (Don't test panic=unwind in panic_main.rs on Fuchsia)
 - #144083 (miri sleep tests: increase slack)
 - #144092 (bootstrap: Detect musl hosts)
 - #144098 (Do not lint private-in-public for RPITIT)
 - #144103 (Rename `emit_unless` to `emit_unless_delay`)
 - #144108 (Ignore tests/run-make/link-eh-frame-terminator/rmake.rs when cross-compiling)
 - #144115 (fix outdated comment)

r? `@ghost`
`@rustbot` modify labels: rollup

rust-timer added a commit that referenced this pull request

Jul 19, 2025
Rollup merge of #141076 - the8472:fix-zip-panic-safety2, r=workingjubilee

fix Zip unsoundness (again)

Some history: The Zip TrustedRandomAccess specialization has tried to emulate the side-effects of the naive implementation for a long time, including backwards iteration. #82292 tried to fix unsoundness (#82291) in that side-effect-preservation code, but this introduced some panic-safety unsoundness (#86443), but the fix #86452 didn't fix it for nested Zip iterators (#137255).

Rather than piling yet another fix ontop of this heap of fixes this PR reduces the number of cases in which side-effects will be preserved; the necessary API guarantee change was approved in #83791 but we haven't made use of that so far.

fixes #137255

github-actions bot pushed a commit to rust-lang/miri that referenced this pull request

Jul 20, 2025

Muscraft pushed a commit to Muscraft/rust that referenced this pull request

Jul 21, 2025
…orkingjubilee

fix Zip unsoundness (again)

Some history: The Zip TrustedRandomAccess specialization has tried to emulate the side-effects of the naive implementation for a long time, including backwards iteration. rust-lang#82292 tried to fix unsoundness (rust-lang#82291) in that side-effect-preservation code, but this introduced some panic-safety unsoundness (rust-lang#86443), but the fix rust-lang#86452 didn't fix it for nested Zip iterators (rust-lang#137255).

Rather than piling yet another fix ontop of this heap of fixes this PR reduces the number of cases in which side-effects will be preserved; the necessary API guarantee change was approved in rust-lang#83791 but we haven't made use of that so far.

fixes rust-lang#137255

Muscraft pushed a commit to Muscraft/rust that referenced this pull request

Jul 21, 2025

github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request

Jul 29, 2025
…orkingjubilee

fix Zip unsoundness (again)

Some history: The Zip TrustedRandomAccess specialization has tried to emulate the side-effects of the naive implementation for a long time, including backwards iteration. rust-lang#82292 tried to fix unsoundness (rust-lang#82291) in that side-effect-preservation code, but this introduced some panic-safety unsoundness (rust-lang#86443), but the fix rust-lang#86452 didn't fix it for nested Zip iterators (rust-lang#137255).

Rather than piling yet another fix ontop of this heap of fixes this PR reduces the number of cases in which side-effects will be preserved; the necessary API guarantee change was approved in rust-lang#83791 but we haven't made use of that so far.

fixes rust-lang#137255

github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request

Jul 29, 2025