-
Couldn't load subscription status.
- Fork 13.9k
fix various aliasing issues in the standard library #78602
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
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
| #[inline(always)] | ||
| pub fn slice_as_mut_ptr(this: &mut [MaybeUninit<T>]) -> *mut T { | ||
| this as *mut [MaybeUninit<T>] as *mut T | ||
| this.as_mut_ptr() as *mut T |
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.
This is not a bugfix but just a stylistic improvement.
|
@bors r+ |
|
📌 Commit 9749eb7 has been approved by |
Rollup of 6 pull requests Successful merges: - rust-lang#78073 (Add #[inline] to some functions in core::str.) - rust-lang#78596 (Fix doc links to std::fmt) - rust-lang#78599 (Add note to process::arg[s] that args shouldn't be escaped or quoted) - rust-lang#78602 (fix various aliasing issues in the standard library) - rust-lang#78603 (expand: Tweak a comment in implementation of `macro_rules`) - rust-lang#78621 (Inline Default::default() for atomics) Failed merges: r? `@ghost`
This fixes various cases where the standard library either used raw pointers after they were already invalidated by using the original reference again, or created raw pointers for one element of a slice and used it to access neighboring elements.