-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Resolve UB in Arc/Weak interaction (2) #72533
Conversation
r? @dtolnay (rust_highfive has picked a reviewer for you, use r? to override) |
That's a very clever trick, I like it. :) |
e351799
to
177e098
Compare
Use raw pointers to avoid making any assertions about the data field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I'd prefer if someone else would also review this --the more eyes, the better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me as well. Thanks for the helpful round of review.
@bors r+ |
📌 Commit ee6e705 has been approved by |
Resolve UB in Arc/Weak interaction (2) Use raw pointers to avoid making any assertions about the data field. Follow up from rust-lang#72479, see that PR for more detail on the motivation. @RalfJung I was able to avoid a lot of the changes to `Weak`, by making a helper type (`WeakInner`) - because of auto-deref and because the fields have the same name, the rest of the code continues to compile.
Resolve UB in Arc/Weak interaction (2) Use raw pointers to avoid making any assertions about the data field. Follow up from rust-lang#72479, see that PR for more detail on the motivation. @RalfJung I was able to avoid a lot of the changes to `Weak`, by making a helper type (`WeakInner`) - because of auto-deref and because the fields have the same name, the rest of the code continues to compile.
Rollup of 6 pull requests Successful merges: - rust-lang#72348 (Fix confusing error message for comma typo in multiline statement) - rust-lang#72533 (Resolve UB in Arc/Weak interaction (2)) - rust-lang#72548 (Add test for old compiler ICE when using `Borrow`) - rust-lang#72606 (Small cell example update) - rust-lang#72610 (Remove font-display settings) - rust-lang#72626 (Add remark regarding DoubleEndedIterator) Failed merges: r? @ghost
Use raw pointers to avoid making any assertions about the data field.
Follow up from #72479, see that PR for more detail on the motivation.
@RalfJung I was able to avoid a lot of the changes to
Weak
, by making a helper type (WeakInner
) - because of auto-deref and because the fields have the same name, the rest of the code continues to compile.