diff --git a/embassy-nrf/src/lib.rs b/embassy-nrf/src/lib.rs index a9df231e..b448f6ab 100644 --- a/embassy-nrf/src/lib.rs +++ b/embassy-nrf/src/lib.rs @@ -1,7 +1,7 @@ #![no_std] #![cfg_attr( feature = "nightly", - feature(generic_associated_types, type_alias_impl_trait, slice_ptr_len) + feature(generic_associated_types, type_alias_impl_trait) )] #[cfg(not(any( diff --git a/embassy-nrf/src/util.rs b/embassy-nrf/src/util.rs index 84848e87..42265dc2 100644 --- a/embassy-nrf/src/util.rs +++ b/embassy-nrf/src/util.rs @@ -22,7 +22,8 @@ pub(crate) fn slice_in_ram(slice: *const [T]) -> bool { /// Return an error if slice is not in RAM. Skips check if slice is zero-length. #[cfg(not(feature = "nrf51"))] pub(crate) fn slice_in_ram_or(slice: *const [T], err: E) -> Result<(), E> { - if slice.len() > 0 && slice_in_ram(slice) { + let (_, len) = slice_ptr_parts(slice); + if len > 0 && slice_in_ram(slice) { Ok(()) } else { Err(err)