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

Fix index calculation in panic guard of clone_from_impl #511

Merged
merged 5 commits into from
Mar 12, 2024

Conversation

Amanieu
Copy link
Member

@Amanieu Amanieu commented Mar 7, 2024

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.

Fixes #510

Amanieu added 3 commits March 4, 2024 17:38
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.
@Amanieu Amanieu force-pushed the clone_from_index branch 4 times, most recently from 4a3334a to 309c473 Compare March 7, 2024 15:57
@Amanieu
Copy link
Member Author

Amanieu commented Mar 12, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Mar 12, 2024

📌 Commit a5eddff has been approved by Amanieu

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Mar 12, 2024

⌛ Testing commit a5eddff with merge 6359e49...

@bors
Copy link
Contributor

bors commented Mar 12, 2024

☀️ Test successful - checks-actions
Approved by: Amanieu
Pushing 6359e49 to master...

@bors bors merged commit 6359e49 into rust-lang:master Mar 12, 2024
24 checks passed
@decathorpe
Copy link

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?

@Amanieu
Copy link
Member Author

Amanieu commented May 1, 2024

@decathorpe I released v0.14.5

@decathorpe
Copy link

Great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants