Skip to content

Commit 307d388

Browse files
committed
Silence unsafe FFI warnings
The rust compiler is issuing false positive improper_ctypes warning, but this is not an issue because only pointers are being passed to mbedtls, and they are used completely opaquely.
1 parent 71bad0c commit 307d388

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mbedtls/src/threading.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ pub static mut mbedtls_mutex_lock: unsafe extern "C" fn(mutex: *mut *mut StaticM
4343
pub static mut mbedtls_mutex_unlock: unsafe extern "C" fn(mutex: *mut *mut StaticMutex) -> c_int =
4444
StaticMutex::unlock;
4545

46+
// The nightly compiler complains that StaticMutex has no representation hint,
47+
// but this is not an issue because this pointer is opaque to mbedtls
48+
#[allow(improper_ctypes)]
4649
impl StaticMutex {
4750
unsafe extern "C" fn init(mutex: *mut *mut StaticMutex) {
4851
if let Some(m) = mutex.as_mut() {

0 commit comments

Comments
 (0)