Fix index calculation in panic guard of clone_from_impl#511
Merged
bors merged 5 commits intorust-lang:masterfrom Mar 12, 2024
Merged
Fix index calculation in panic guard of clone_from_impl#511bors merged 5 commits intorust-lang:masterfrom
bors merged 5 commits intorust-lang:masterfrom
Conversation
Previously, it was possible for an uninitialized element to be dropped if all of the following occurred: - `clone_from` was called where `T: !Copy`. - The `clone` implementation of `T` panicked. - The first bucket of the source `HashMap` contained an entry.
This is a new lint introduced in rustc.
4a3334a to
309c473
Compare
37864e7 to
a5eddff
Compare
Member
Author
|
@bors r+ |
Contributor
Contributor
Contributor
|
☀️ Test successful - checks-actions |
|
It looks like this issue (different optimizations with latest Rust 1.77+ and / or LLVM?) is now happening much more frequently. The Fedora Linux CI for hashbrown has started to fail quite often due to test failures that would be fixed by this commit. Since v0.14.4 was yanked due to breaking API changes, this fix never landed in a non-yanked stable release of hashbrown. Would it be possible to backport this onto a v0.14 branch based on v0.14.3 and release it as v0.14.5? |
Member
Author
|
@decathorpe I released v0.14.5 |
|
Great, thank you! |
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.
Previously, it was possible for an uninitialized element to be dropped if all of the following occurred:
clone_fromwas called whereT: !Copy.cloneimplementation ofTpanicked.HashMapcontained an entry.Fixes #510