From 1b70afd5267455366baeaf886f7a5f9d4bdbe842 Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Mon, 15 Jul 2024 07:30:11 +0000 Subject: [PATCH] Move safety comment outside unsafe block --- std/src/sys/pal/windows/compat.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/std/src/sys/pal/windows/compat.rs b/std/src/sys/pal/windows/compat.rs index 190e6ba0cf24f..49fa1603f3e1e 100644 --- a/std/src/sys/pal/windows/compat.rs +++ b/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 { + // SAFETY: A CStr is always null terminated. unsafe { - // SAFETY: A CStr is always null terminated. let module = c::GetModuleHandleA(name.as_ptr().cast::()); NonNull::new(module).map(Self) }