aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/safer_unchecked.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/safer_unchecked.rs b/src/safer_unchecked.rs
index afd0355..34216bc 100644
--- a/src/safer_unchecked.rs
+++ b/src/safer_unchecked.rs
@@ -7,6 +7,7 @@ pub trait GetSaferUnchecked<T> {
}
impl<T> GetSaferUnchecked<T> for [T] {
+ #[inline(always)]
unsafe fn get_kinda_unchecked<I>(&self, index: I) -> &<I as SliceIndex<[T]>>::Output
where
I: SliceIndex<[T]>,
@@ -19,6 +20,7 @@ impl<T> GetSaferUnchecked<T> for [T] {
}
}
+#[inline(always)]
pub unsafe fn unreachable_kinda_unchecked() -> ! {
if cfg!(debug_assertions) {
panic!("UB: Unreachable unchecked was executed")