diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2020-05-01 18:46:23 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2020-05-01 22:16:38 +0200 |
commit | fd2384b7fab14732efde99da8affd830e2334e16 (patch) | |
tree | a17111e3363c457ec727b52023212c113d8304f6 /safe_libc/src/util.rs | |
parent | 5b449f4e1e43bc59109da5a37edf5ec911d3df8e (diff) | |
download | neco-fd2384b7fab14732efde99da8affd830e2334e16.tar neco-fd2384b7fab14732efde99da8affd830e2334e16.zip |
Nightly stuff
Diffstat (limited to 'safe_libc/src/util.rs')
-rw-r--r-- | safe_libc/src/util.rs | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/safe_libc/src/util.rs b/safe_libc/src/util.rs index b8a4ed5..e91494e 100644 --- a/safe_libc/src/util.rs +++ b/safe_libc/src/util.rs @@ -1,16 +1,3 @@ -use core::mem; - -#[inline] -pub fn zst<T>(len: usize) -> bool { - mem::size_of::<T>() == 0 || len == 0 -} - -#[inline] -pub fn check_ptr<T>(p: *const T, len: usize) { - debug_assert!((p as usize) % mem::align_of::<T>() == 0, "unaligned ptr"); - assert!(zst::<T>(len) || !p.is_null(), "NULL ptr"); -} - #[inline] pub fn must_succeed<T>(p: *mut T) -> *mut T { assert!(!p.is_null(), "allocation failure"); |