about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Denton <chris@chrisdenton.dev>2024-07-15 07:30:11 +0000
committerChris Denton <chris@chrisdenton.dev>2024-07-15 07:30:11 +0000
commit7e16d5fb6111fc974c5b9a2aff951f2eb07b3deb (patch)
tree013f4670c75f897c1ac32faee970638047966d09
parent3411a025d5716967ba9bc8b259acd687998bcc40 (diff)
downloadrust-7e16d5fb6111fc974c5b9a2aff951f2eb07b3deb.tar.gz
rust-7e16d5fb6111fc974c5b9a2aff951f2eb07b3deb.zip
Move safety comment outside unsafe block
-rw-r--r--library/std/src/sys/pal/windows/compat.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/sys/pal/windows/compat.rs b/library/std/src/sys/pal/windows/compat.rs
index 190e6ba0cf2..49fa1603f3e 100644
--- a/library/std/src/sys/pal/windows/compat.rs
+++ b/library/std/src/sys/pal/windows/compat.rs
@@ -111,8 +111,8 @@ impl Module {
     /// This should only be use for modules that exist for the lifetime of std
     /// (e.g. kernel32 and ntdll).
     pub unsafe fn new(name: &CStr) -> Option<Self> {
+        // SAFETY: A CStr is always null terminated.
         unsafe {
-            // SAFETY: A CStr is always null terminated.
             let module = c::GetModuleHandleA(name.as_ptr().cast::<u8>());
             NonNull::new(module).map(Self)
         }