-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
std: Use mem::replace in TLS initialization #30267
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
While there is indeed a codegen/soundness bug involving panicking destructors, the root cause of the issue here is that you hold a |
Due to rust-lang#30228 it's not currently sound to do `*ptr = Some(value)`, so instead use `mem::replace` which fixes the soundness hole for now.
8e16eff
to
9e0ff77
Compare
@bors r+ |
📌 Commit 9e0ff77 has been approved by |
⌛ Testing commit 9e0ff77 with merge ce13275... |
Due to #30228 it's not currently sound to do `*ptr = Some(value)`, so instead use `mem::replace` which fixes the soundness hole for now.
Due to #30228 it's not currently sound to do
*ptr = Some(value)
, so insteaduse
mem::replace
which fixes the soundness hole for now.