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

1.36 changes the UnwindSafe impl precondition for HashMap #62301

Closed
CAD97 opened this issue Jul 2, 2019 · 3 comments · Fixed by #62304
Closed

1.36 changes the UnwindSafe impl precondition for HashMap #62301

CAD97 opened this issue Jul 2, 2019 · 3 comments · Fixed by #62304
Labels
A-collections Area: std::collections. C-bug Category: This is a bug. regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@CAD97
Copy link
Contributor

CAD97 commented Jul 2, 2019

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=0e5a528fc978a90aa15bbf01f68dd1bf

assert_unwind_safe::<HashMap<(), UnsafeCell<()>>>();

Successfully compiles on stable 1.35, fails on beta/pre 1.36.

@jonas-schievink jonas-schievink added C-bug Category: This is a bug. I-nominated regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. A-collections Area: std::collections. labels Jul 2, 2019
@CAD97
Copy link
Contributor Author

CAD97 commented Jul 2, 2019

First reported to FireFox ESR and shared on irlo here: https://internals.rust-lang.org/t/rust-1-36-0-pre-release-testing/10490/2?u=cad97

@SimonSapin
Copy link
Contributor

rust/src/libstd/panic.rs

Lines 209 to 212 in ef064d2

#[unstable(feature = "ptr_internals", issue = "0")]
impl<T: UnwindSafe + ?Sized> UnwindSafe for Unique<T> {}
#[stable(feature = "nonnull", since = "1.25.0")]
impl<T: RefUnwindSafe + ?Sized> UnwindSafe for NonNull<T> {}

The UnwindSafe impl for Unique<T> requires T: UnwindSafe, but the one for NonZero<T> requires T: RefUnwindSafe.

@SimonSapin
Copy link
Contributor

#62304 is a possible fix.

SimonSapin added a commit to SimonSapin/rust that referenced this issue Jul 2, 2019
Fixes rust-lang#62301, a regression in 1.36.0 which was caused by hashbrown using `NonZero<T>` where the older hashmap used `Unique<T>`.
Mark-Simulacrum pushed a commit to Mark-Simulacrum/rust that referenced this issue Jul 2, 2019
Fixes rust-lang#62301, a regression in 1.36.0 which was caused by hashbrown using `NonZero<T>` where the older hashmap used `Unique<T>`.
bob-beck pushed a commit to openbsd/ports that referenced this issue Jul 2, 2019
found by semarie@ in
https://reviews.freebsd.org/D20810#change-K68aYoUXfAu1, regression in
rust itself tracked in rust-lang/rust#62301

Builds fine with rust 1.35.
bob-beck pushed a commit to openbsd/ports that referenced this issue Jul 2, 2019
found by semarie@ in
https://reviews.freebsd.org/D20810#change-K68aYoUXfAu1, regression in
rust itself tracked in rust-lang/rust#62301

Builds fine with rust 1.35.
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Jul 3, 2019
HashMap is UnwindSafe

Fixes rust-lang#62301, a regression in 1.36.0-pre which was caused by hashbrown using `NonZero<T>` where the older hashmap used `Unique<T>`.
Mark-Simulacrum pushed a commit to Mark-Simulacrum/rust that referenced this issue Jul 3, 2019
Fixes rust-lang#62301, a regression in 1.36.0 which was caused by hashbrown using `NonZero<T>` where the older hashmap used `Unique<T>`.
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Jul 3, 2019
HashMap is UnwindSafe

Fixes rust-lang#62301, a regression in 1.36.0-pre which was caused by hashbrown using `NonZero<T>` where the older hashmap used `Unique<T>`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-collections Area: std::collections. C-bug Category: This is a bug. regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants