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:
@@ -200,11 +200,7 @@ unsafe fn register_unwind_info(obj: &File, text: &[u8]) -> Result<Option<UnwindR
|
||||
return Ok(None);
|
||||
}
|
||||
Ok(Some(
|
||||
UnwindRegistration::new(
|
||||
text.as_ptr() as *mut _,
|
||||
unwind_info.as_ptr() as *mut _,
|
||||
unwind_info.len(),
|
||||
)
|
||||
.context("failed to create unwind info registration")?,
|
||||
UnwindRegistration::new(text.as_ptr(), unwind_info.as_ptr(), unwind_info.len())
|
||||
.context("failed to create unwind info registration")?,
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user