Skip to content

Commit

Permalink
allowed wrapper to be dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexLB99 committed Dec 20, 2024
1 parent 55d6634 commit 2c4de37
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/core/src/intrinsics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4595,6 +4595,7 @@ pub(crate) const fn miri_promise_symbolic_alignment(ptr: *const (), align: usize
//We need this wrapper because transmute_unchecked is an intrinsic, for which Kani does not currently support contracts
#[requires(crate::mem::size_of::<T>() == crate::mem::size_of::<U>())] //T and U have same size (transmute_unchecked does not guarantee this)
#[ensures(|ret: &U| (ub_checks::can_dereference(ret as *const U)))] //output can be deref'd as value of type U
#[allow(dead_code)]
unsafe fn transmute_unchecked_wrapper<T,U>(input: T) -> U {
unsafe { transmute_unchecked(input) }
}
Expand Down

0 comments on commit 2c4de37

Please sign in to comment.