about summary refs log tree commit diff
path: root/library/std/src/path.rs
diff options
context:
space:
mode:
authorZachary S <zasample18+github@gmail.com>2024-11-01 00:07:59 -0500
committerZachary S <zasample18+github@gmail.com>2024-11-12 15:08:41 -0600
commite0c1c8bc5058cd3f8831b235c5963ab89840b33b (patch)
treef94b56c98e276e94c3d8c5b77773fb9d0a0d059b /library/std/src/path.rs
parent6503543d11583d1686d4989847b2afbec8d9fdba (diff)
downloadrust-e0c1c8bc5058cd3f8831b235c5963ab89840b33b.tar.gz
rust-e0c1c8bc5058cd3f8831b235c5963ab89840b33b.zip
Make `CloneToUninit` dyn-compatible
Diffstat (limited to 'library/std/src/path.rs')
-rw-r--r--library/std/src/path.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/library/std/src/path.rs b/library/std/src/path.rs
index 5662a44d832..b0291e3aa19 100644
--- a/library/std/src/path.rs
+++ b/library/std/src/path.rs
@@ -2128,7 +2128,7 @@ impl AsRef<OsStr> for PathBuf {
 /// ```
 #[cfg_attr(not(test), rustc_diagnostic_item = "Path")]
 #[stable(feature = "rust1", since = "1.0.0")]
-// `Path::new` current implementation relies
+// `Path::new` and `impl CloneToUninit for Path` current implementation relies
 // on `Path` being layout-compatible with `OsStr`.
 // However, `Path` layout is considered an implementation detail and must not be relied upon.
 #[repr(transparent)]
@@ -3170,9 +3170,9 @@ impl Path {
 unsafe impl CloneToUninit for Path {
     #[inline]
     #[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(&raw mut (*dst).inner) }
+    unsafe fn clone_to_uninit(&self, dst: *mut u8) {
+        // SAFETY: Path is just a transparent wrapper around OsStr
+        unsafe { self.inner.clone_to_uninit(dst) }
     }
 }