diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2018-10-23 23:09:44 +0200 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2018-11-10 01:10:07 +0100 |
| commit | e15c62d61fa02fac93992db9297aa4a8a56cef93 (patch) | |
| tree | 7f1e21f22c66f3d4988fdbf347031bd6d67a3af0 /src/libcore/slice | |
| parent | d1d2aa22c0d15465af1daccdb3821450c98d0ed0 (diff) | |
| download | rust-e15c62d61fa02fac93992db9297aa4a8a56cef93.tar.gz rust-e15c62d61fa02fac93992db9297aa4a8a56cef93.zip | |
revert making internal APIs const fn.
Diffstat (limited to 'src/libcore/slice')
| -rw-r--r-- | src/libcore/slice/memchr.rs | 6 | ||||
| -rw-r--r-- | src/libcore/slice/mod.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libcore/slice/memchr.rs b/src/libcore/slice/memchr.rs index deaeb53e84a..cf95333af9c 100644 --- a/src/libcore/slice/memchr.rs +++ b/src/libcore/slice/memchr.rs @@ -29,19 +29,19 @@ const HI_USIZE: usize = HI_U64 as usize; /// bytes where the borrow propagated all the way to the most significant /// bit." #[inline] -const fn contains_zero_byte(x: usize) -> bool { +fn contains_zero_byte(x: usize) -> bool { x.wrapping_sub(LO_USIZE) & !x & HI_USIZE != 0 } #[cfg(target_pointer_width = "16")] #[inline] -const fn repeat_byte(b: u8) -> usize { +fn repeat_byte(b: u8) -> usize { (b as usize) << 8 | b as usize } #[cfg(not(target_pointer_width = "16"))] #[inline] -const fn repeat_byte(b: u8) -> usize { +fn repeat_byte(b: u8) -> usize { (b as usize) * (::usize::MAX / 255) } diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index dae425da789..fece328f51f 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -2737,7 +2737,7 @@ impl<'a, T> IntoIterator for &'a mut [T] { // Macro helper functions #[inline(always)] -const fn size_from_ptr<T>(_: *const T) -> usize { +fn size_from_ptr<T>(_: *const T) -> usize { mem::size_of::<T>() } |
