Use ptr::cast instead of as casts in several places. (#3507)
`ptr::cast` has the advantage of being unable to silently cast `*const T` to `*mut T`. This turned up several places that were performing such casts, which this PR also fixes.
This commit is contained in:
@@ -874,7 +874,7 @@ fn lookup_with_dlsym(name: &str) -> Option<*const u8> {
|
||||
// try to find the searched symbol in the currently running executable
|
||||
ptr::null_mut(),
|
||||
// try to find the searched symbol in local c runtime
|
||||
winapi::um::libloaderapi::GetModuleHandleA(MSVCRT_DLL.as_ptr() as *const i8),
|
||||
winapi::um::libloaderapi::GetModuleHandleA(MSVCRT_DLL.as_ptr().cast::<i8>()),
|
||||
];
|
||||
|
||||
for handle in &handles {
|
||||
|
||||
Reference in New Issue
Block a user