Add clippy error checking in lint step

This commit is contained in:
Mark McCaskey
2020-01-17 15:47:45 -08:00
parent 59dc6fd889
commit 5931944a21
6 changed files with 17 additions and 13 deletions

View File

@ -627,9 +627,11 @@ pub mod x64 {
use crate::vm::Ctx;
use std::any::Any;
#[allow(clippy::cast_ptr_alignment)]
unsafe fn compute_vmctx_deref(vmctx: *const Ctx, seq: &[usize]) -> u64 {
let mut ptr = &vmctx as *const *const Ctx as *const u8;
for x in seq {
debug_assert!(ptr.align_offset(std::mem::align_of::<*const u8>()) == 0);
ptr = (*(ptr as *const *const u8)).offset(*x as isize);
}
ptr as usize as u64

View File

@ -570,6 +570,7 @@ pub struct FuncCtx {
impl FuncCtx {
/// Offset to the `vmctx` field.
#[allow(clippy::erasing_op)]
pub const fn offset_vmctx() -> u8 {
0 * (mem::size_of::<usize>() as u8)
}