Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4875d0fe authored by Andrew Walbran's avatar Andrew Walbran
Browse files

Add safety comments, or temporarily allow them to be omitted.

These will soon be required by a lint.

Bug: 290018030
Test: m rust
Change-Id: I13fc1bc46b855603b4ee8410e89fc7ec75c27e65
parent c6e44800
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

pub use crate::parameter_provider::*;

#[allow(unsafe_op_in_unsafe_fn)]
#[cxx::bridge(namespace = "bluetooth::fake_bluetooth_keystore")]
/// ffi extern module
pub mod ffi {
+4 −0
Original line number Diff line number Diff line
@@ -18,7 +18,11 @@ pub struct ParameterProvider {
    lock: Mutex<i32>,
}

// SAFETY: Nothing about `BluetoothKeystoreInterface` is bound to a specific thread, and all other
// fields are `Send`.
unsafe impl Send for ParameterProvider {}

// SAFETY: Nothing about `BluetoothKeystoreInterface` is bound to a specific thread.
unsafe impl Send for BluetoothKeystoreInterface {}

impl ParameterProvider {
+1 −0
Original line number Diff line number Diff line
#[cxx::bridge(namespace = bluetooth::common::init_flags)]
#[allow(unsafe_op_in_unsafe_fn)]
mod ffi {
    struct InitFlagWithValue {
        flag: &'static str,
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ async fn provide_hidl_hal(rt: Arc<Runtime>) -> RawHal {
#[cxx::bridge(namespace = bluetooth::hal)]
// TODO Either use or remove these functions, this shouldn't be the long term state
#[allow(dead_code)]
#[allow(unsafe_op_in_unsafe_fn)]
mod ffi {
    unsafe extern "C++" {
        include!("src/hal/ffi/hidl.h");
+2 −0
Original line number Diff line number Diff line
@@ -19,12 +19,14 @@ use super::{
    ConnectionManagerClient, LeConnection,
};

// SAFETY: `LeAclManagerShim` can be passed between threads.
unsafe impl Send for LeAclManagerShim {}

#[cxx::bridge]
#[allow(clippy::needless_lifetimes)]
#[allow(clippy::too_many_arguments)]
#[allow(missing_docs)]
#[allow(unsafe_op_in_unsafe_fn)]
mod inner {
    impl UniquePtr<LeAclManagerShim> {}

Loading