We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c286d5 commit 1b70afdCopy full SHA for 1b70afd
std/src/sys/pal/windows/compat.rs
@@ -111,8 +111,8 @@ impl Module {
111
/// This should only be use for modules that exist for the lifetime of std
112
/// (e.g. kernel32 and ntdll).
113
pub unsafe fn new(name: &CStr) -> Option<Self> {
114
+ // SAFETY: A CStr is always null terminated.
115
unsafe {
- // SAFETY: A CStr is always null terminated.
116
let module = c::GetModuleHandleA(name.as_ptr().cast::<u8>());
117
NonNull::new(module).map(Self)
118
}
0 commit comments