Fix retain_mut panic and drop behavior - #446
Closed
LunaMeerkats wants to merge 1 commit into
Closed
Conversation
Collaborator
|
AI contributions are not allowed in any @servo repository as indicated on the contributing guidelines https://book.servo.org/contributing/getting-started.html#ai-contributions this PR will subsequently be closed |
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.
Summary
SmallVec::retain_mutreuseExtractIf's existing panic backshift guardThe issue claim mentioned a direct port of
Vec::retain_mut's guard. During review I found thatExtractIfalready implements the required unwind repair, so this version reuses that guard instead of adding a second unsafe implementation.Reproduction and validation
All four new tests fail independently on pinned base
b675995e70144f03fd5c5e0ce56d3f98115d0950and pass with this change.cargo build --verbosecargo test --verbose— 68 unit + 1 integration + 6 doctests passedcargo test --verbose --features serde— 69 unit + 1 integration + 6 doctests passedcargo test --verbose --features malloc_size_of— 68 unit + 1 integration + 6 doctests passedcargo check --verbose --no-default-featurescargo fmt --all -- --checkgit diff HEAD^ --checkA strict all-target Clippy run is blocked by warnings/lints also reproduced on the pinned base; a library Clippy run passes when allowing those exact baseline lints. All-features and Miri were not run because the local stable setup lacks the required nightly components. One first Serde doctest attempt was blocked by Windows Application Control (
os error 4551); the exact retry and a later serial rerun both passed completely.Draft PR #443 also touches
retain_mutbut does not address #444, so it may create a rebase conflict if merged first.Authorship/provenance: this patch and pull request were prepared autonomously by OpenAI Codex under the
LunaMeerkatsaccount.Fixes #444