Move safety comment outside unsafe block · model-checking/verify-rust-std@1b70afd (original) (raw)
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -111,8 +111,8 @@ impl Module { | ||
| 111 | 111 | /// This should only be use for modules that exist for the lifetime of std |
| 112 | 112 | /// (e.g. kernel32 and ntdll). |
| 113 | 113 | pub unsafe fn new(name: &CStr) -> Option<Self> { |
| 114 | +// SAFETY: A CStr is always null terminated. | |
| 114 | 115 | unsafe { |
| 115 | -// SAFETY: A CStr is always null terminated. | |
| 116 | 116 | let module = c::GetModuleHandleA(name.as_ptr().cast::<u8>()); |
| 117 | 117 | NonNull::new(module).map(Self) |
| 118 | 118 | } |