aboutsummaryrefslogtreecommitdiff
path: root/rust
diff options
context:
space:
mode:
authorAdam Langley <agl@chromium.org>2024-02-16 08:55:17 -0800
committerBoringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com>2024-02-16 17:24:59 +0000
commit23824fa0fed94f4660ffafb15aaea8b317f2c8a6 (patch)
treed833618e7c8e115710811b29125119c149aaa530 /rust
parentea003bdaab1a6611b1a09f4e7f4cae3fa7390588 (diff)
downloadboringssl-23824fa0fed94f4660ffafb15aaea8b317f2c8a6.zip
boringssl-23824fa0fed94f4660ffafb15aaea8b317f2c8a6.tar.gz
boringssl-23824fa0fed94f4660ffafb15aaea8b317f2c8a6.tar.bz2
bssl-crypto: remove unused code.chromium-stable
The latest Rust toolchain has started flagging these (correctly) as unused. Change-Id: I702e0ac7bfe47c7546e44debf7f53c4ade8e5dd6 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/66328 Commit-Queue: Bob Beck <bbe@google.com> Reviewed-by: Bob Beck <bbe@google.com> Auto-Submit: Adam Langley <agl@google.com>
Diffstat (limited to 'rust')
-rw-r--r--rust/bssl-crypto/src/lib.rs37
1 files changed, 0 insertions, 37 deletions
diff --git a/rust/bssl-crypto/src/lib.rs b/rust/bssl-crypto/src/lib.rs
index bb80ef4..5a6e58a 100644
--- a/rust/bssl-crypto/src/lib.rs
+++ b/rust/bssl-crypto/src/lib.rs
@@ -101,9 +101,6 @@ impl<const N: usize> FfiSlice for [u8; N] {
/// See the comment [`FfiSlice`].
trait FfiMutSlice {
fn as_mut_ffi_ptr(&mut self) -> *mut u8;
- fn as_ffi_void_ptr(&mut self) -> *mut c_void {
- self.as_mut_ffi_ptr() as *mut c_void
- }
}
impl FfiMutSlice for [u8] {
@@ -203,17 +200,6 @@ unsafe trait ForeignTypeRef: Sized {
unsafe { &*(ptr as *mut _) }
}
- /// Constructs a mutable reference of this type from its raw type.
- ///
- /// # Safety
- ///
- /// `ptr` must be a valid, unique, instance of the type for the `'a` lifetime.
- #[inline]
- unsafe fn from_ptr_mut<'a>(ptr: *mut Self::CType) -> &'a mut Self {
- debug_assert!(!ptr.is_null());
- unsafe { &mut *(ptr as *mut _) }
- }
-
/// Returns a raw pointer to the wrapped value.
#[inline]
fn as_ptr(&self) -> *mut Self::CType {
@@ -221,29 +207,6 @@ unsafe trait ForeignTypeRef: Sized {
}
}
-/// A helper trait implemented by types which has an owned reference to foreign types.
-///
-/// # Safety
-///
-/// Implementations of `ForeignType` must guarantee the following:
-///
-/// - `Self::from_ptr(x).as_ptr() == x`
-unsafe trait ForeignType {
- /// The raw C type.
- type CType;
-
- /// Constructs an instance of this type from its raw type.
- ///
- /// # Safety
- ///
- /// - `ptr` must be a valid, immutable, instance of `CType`.
- /// - Ownership of `ptr` is passed to the implementation, and will free `ptr` when dropped.
- unsafe fn from_ptr(ptr: *mut Self::CType) -> Self;
-
- /// Returns a raw pointer to the wrapped value.
- fn as_ptr(&self) -> *mut Self::CType;
-}
-
/// Returns a BoringSSL structure that is initialized by some function.
/// Requires that the given function completely initializes the value.
///