shadow_shim_helper_rs/notnull.rs
1/// Panics if NULL (when debug asserts are enabled), and returns the pointer.
2pub fn notnull_debug<T>(p: *const T) -> *const T {
3 debug_assert!(!p.is_null());
4 p
5}
6
7/// Panics if NULL (when debug asserts are enabled), and returns the pointer.
8pub fn notnull_mut_debug<T>(p: *mut T) -> *mut T {
9 debug_assert!(!p.is_null());
10 p
11}
12
13/// Panics if NULL and returns the pointer.
14pub fn notnull<T>(p: *const T) -> *const T {
15 assert!(!p.is_null());
16 p
17}
18
19/// Panics if NULL and returns the pointer.
20pub fn notnull_mut<T>(p: *mut T) -> *mut T {
21 assert!(!p.is_null());
22 p
23}