Skip to content

Commit

Permalink
Fix warning about unused method (#3488)
Browse files Browse the repository at this point in the history
fix warning about unused method
  • Loading branch information
djmitche authored Jun 15, 2024
1 parent bba010c commit 161463d
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/tc/lib/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub(crate) trait PassByPointer: Sized {
/// # Safety
///
/// - arg must not be NULL
/// - arg must be a value returned from Box::into_raw (via return_ptr or ptr_to_arg_out)
/// - arg must be a value returned from Box::into_raw (via return_ptr)
/// - arg becomes invalid and must not be used after this call
unsafe fn take_from_ptr_arg(arg: *mut Self) -> Self {
debug_assert!(!arg.is_null());
Expand Down Expand Up @@ -127,19 +127,6 @@ pub(crate) trait PassByPointer: Sized {
unsafe fn return_ptr(self) -> *mut Self {
Box::into_raw(Box::new(self))
}

/// Return a value to C, transferring ownership, via an "output parameter".
///
/// # Safety
///
/// - the caller must ensure that the value is eventually freed
/// - arg_out must not be NULL
/// - arg_out must point to valid, properly aligned memory for a pointer value
unsafe fn ptr_to_arg_out(self, arg_out: *mut *mut Self) {
debug_assert!(!arg_out.is_null());
// SAFETY: see docstring
unsafe { *arg_out = self.return_ptr() };
}
}

/// Support for C lists of objects referenced by value.
Expand Down

0 comments on commit 161463d

Please sign in to comment.