rust-lang / hashbrown

Rust port of Google's SwissTable hash map
https://rust-lang.github.io/hashbrown
Apache License 2.0
2.38k stars 275 forks source link

Fix index calculation in panic guard of clone_from_impl #511

Closed Amanieu closed 6 months ago

Amanieu commented 6 months ago

Previously, it was possible for an uninitialized element to be dropped if all of the following occurred:

Fixes #510

Amanieu commented 6 months ago

@bors r+

bors commented 6 months ago

:pushpin: Commit a5eddffcb1f62fffdd74fd379cf1606408c7f288 has been approved by Amanieu

It is now in the queue for this repository.

bors commented 6 months ago

:hourglass: Testing commit a5eddffcb1f62fffdd74fd379cf1606408c7f288 with merge 6359e49e0b753f052e311ff79a7c9fa7c9281a44...

bors commented 6 months ago

:sunny: Test successful - checks-actions Approved by: Amanieu Pushing 6359e49e0b753f052e311ff79a7c9fa7c9281a44 to master...

decathorpe commented 4 months ago

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 commented 4 months ago

@decathorpe I released v0.14.5

decathorpe commented 4 months ago

Great, thank you!