Skip to content

Commit 13a1255

Browse files
bors[bot]Goirad
andauthored
Merge #82
82: Silence unsafe FFI warnings r=jack-fortanix a=Goirad 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. Co-authored-by: Dario Gonzalez <[email protected]>
2 parents 71bad0c + 307d388 commit 13a1255

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)