about summary refs log tree commit diff
path: root/library/std/src/path
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
parent6503543d11583d1686d4989847b2afbec8d9fdba (diff)
Make `CloneToUninit` dyn-compatible
Diffstat (limited to 'library/std/src/path')
-rw-r--r--library/std/src/path/tests.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/path/tests.rs b/library/std/src/path/tests.rs
index b75793d2bc9..ff3f7151bb8 100644
--- a/library/std/src/path/tests.rs
+++ b/library/std/src/path/tests.rs
@@ -2068,7 +2068,7 @@ fn clone_to_uninit() {
     let a = Path::new("hello.txt");
 
     let mut storage = vec![MaybeUninit::<u8>::uninit(); size_of_val::<Path>(a)];
-    unsafe { a.clone_to_uninit(ptr::from_mut::<[_]>(storage.as_mut_slice()) as *mut Path) };
+    unsafe { a.clone_to_uninit(ptr::from_mut::<[_]>(storage.as_mut_slice()).cast()) };
     assert_eq!(a.as_os_str().as_encoded_bytes(), unsafe {
         MaybeUninit::slice_assume_init_ref(&storage)
     });
@@ -2076,6 +2076,6 @@ fn clone_to_uninit() {
     let mut b: Box<Path> = Path::new("world.exe").into();
     assert_eq!(size_of_val::<Path>(a), size_of_val::<Path>(&b));
     assert_ne!(a, &*b);
-    unsafe { a.clone_to_uninit(ptr::from_mut::<Path>(&mut b)) };
+    unsafe { a.clone_to_uninit(ptr::from_mut::<Path>(&mut b).cast()) };
     assert_eq!(a, &*b);
 }