diff options
| author | Jakub Beránek <berykubik@gmail.com> | 2025-08-13 07:03:52 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-13 07:03:52 +0200 |
| commit | 8cb78fe3b63ab1f83d084411cb1f768ce9443a3d (patch) | |
| tree | b4277e319a2c50fa0ebec963b40249ee3800c804 /library/std/src | |
| parent | c4e82abe93f19878ba0ee09779ef18a53896150e (diff) | |
| parent | d6945f6d8c15bd692000cd7f8d76d171ae27b8c9 (diff) | |
| download | rust-8cb78fe3b63ab1f83d084411cb1f768ce9443a3d.tar.gz rust-8cb78fe3b63ab1f83d084411cb1f768ce9443a3d.zip | |
Rollup merge of #145325 - clarfonthey:cast-init, r=scottmcm
Add `cast_init` and `cast_uninit` methods for pointers ACP: rust-lang/libs-team#627 Tracking issue: rust-lang/rust#145036 This includes an incredibly low-effort search to find uses that could be switched to using these methods. I only searched for `cast::<\w>` and `cast::<MaybeUninit` because there would otherwise be way too much to look through, and I also didn't modify anything inside submodules/subtrees.
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/lib.rs | 1 | ||||
| -rw-r--r-- | library/std/src/sys/fs/windows.rs | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 25355efd20e..07b38c65898 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -329,6 +329,7 @@ // tidy-alphabetical-start #![feature(bstr)] #![feature(bstr_internals)] +#![feature(cast_maybe_uninit)] #![feature(char_internals)] #![feature(clone_to_uninit)] #![feature(const_cmp)] diff --git a/library/std/src/sys/fs/windows.rs b/library/std/src/sys/fs/windows.rs index 09feddd0be9..bb3e4bc30ca 100644 --- a/library/std/src/sys/fs/windows.rs +++ b/library/std/src/sys/fs/windows.rs @@ -1606,7 +1606,7 @@ pub fn junction_point(original: &Path, link: &Path) -> io::Result<()> { }; unsafe { let ptr = header.PathBuffer.as_mut_ptr(); - ptr.copy_from(abs_path.as_ptr().cast::<MaybeUninit<u16>>(), abs_path.len()); + ptr.copy_from(abs_path.as_ptr().cast_uninit(), abs_path.len()); let mut ret = 0; cvt(c::DeviceIoControl( |
