rav1d-safe 0.5.5

Safe SIMD fork of rav1d - Rust AV1 decoder with archmage intrinsics
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![deny(unsafe_op_in_unsafe_fn)]

use std::hint::unreachable_unchecked;

/// A stable version of [`core::intrinsics::assume`].
///
/// # Safety
///
/// `condition` must always be `true`.
#[inline(always)]
#[allow(unsafe_code)]
pub const unsafe fn assume(condition: bool) {
    if !condition {
        // SAFETY: `condition` is `true` by the `# Safety` preconditions.
        unsafe { unreachable_unchecked() };
    }
}