Skip to content

Commit

Permalink
Allow pointer transmutes
Browse files Browse the repository at this point in the history
  • Loading branch information
JustusAdam committed Nov 22, 2023
1 parent 0b6ba1e commit b968497
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions library/kani/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ impl<'a, 'b, T> Pointer<'a> for &'b T {
std::mem::transmute(self)
}

#[allow(clippy::transmute_ptr_to_ref)]
unsafe fn assignable(self) -> &'a mut Self::Inner {
std::mem::transmute(self as *const T)
}
Expand All @@ -116,6 +117,7 @@ impl<'a, 'b, T> Pointer<'a> for &'b mut T {
std::mem::transmute(self as *mut T)
}

#[allow(clippy::transmute_ptr_to_ref)]
unsafe fn assignable(self) -> &'a mut Self::Inner {
std::mem::transmute(self)
}
Expand All @@ -127,6 +129,7 @@ impl<'a, T> Pointer<'a> for *const T {
&*self as &'a T
}

#[allow(clippy::transmute_ptr_to_ref)]
unsafe fn assignable(self) -> &'a mut Self::Inner {
std::mem::transmute(self)
}
Expand All @@ -138,6 +141,7 @@ impl<'a, T> Pointer<'a> for *mut T {
&*self as &'a T
}

#[allow(clippy::transmute_ptr_to_ref)]
unsafe fn assignable(self) -> &'a mut Self::Inner {
std::mem::transmute(self)
}
Expand Down

0 comments on commit b968497

Please sign in to comment.