Use &raw in the standard library

Since the stabilization in #127679 has reached stage0, 1.82-beta, we can
start using `&raw` freely, and even the soft-deprecated `ptr::addr_of!`
and `ptr::addr_of_mut!` can stop allowing the unstable feature.

I intentionally did not change any documentation or tests, but the rest
of those macro uses are all now using `&raw const` or `&raw mut` in the
standard library.
This commit is contained in:
Josh Stone
2024-09-25 17:03:20 -07:00
parent 0399709cdc
commit f4d9d1a0ea
51 changed files with 150 additions and 185 deletions

View File

@@ -3144,7 +3144,7 @@ unsafe impl CloneToUninit for Path {
#[cfg_attr(debug_assertions, track_caller)]
unsafe fn clone_to_uninit(&self, dst: *mut Self) {
// SAFETY: Path is just a wrapper around OsStr
unsafe { self.inner.clone_to_uninit(core::ptr::addr_of_mut!((*dst).inner)) }
unsafe { self.inner.clone_to_uninit(&raw mut (*dst).inner) }
}
}