Skip to content

Commit

Permalink
Fix error when lender feature is not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jhg committed Jan 14, 2025
1 parent 20efa13 commit 3eee309
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ pub fn not_null_pointer<T>(pointer: *const T) -> Result<(), PointerError> {

#[inline]
pub fn lent_pointer<T: 'static>(pointer: *const T) -> Result<(), PointerError> {
#[cfg(not(all(feature = "std", feature = "lender")))]
return Ok(());
#[cfg(all(feature = "std", feature = "lender"))]
match lender::lent_type_of(pointer) {
Some(type_id) if type_id != std::any::TypeId::of::<T>() => {
Expand Down

0 comments on commit 3eee309

Please sign in to comment.