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

Commit 8f06c47a authored by Stephen Hines's avatar Stephen Hines
Browse files

Adjust Safety annotation but also just silence lint warning

This external function declaration isn't able to be handled nicely by
clippy in this case, so we suppress the lint. I also added a formatting
fix to make it look more like other Safety sections.

```
error: unsafe function's docs miss `# Safety` section
  --> packages/modules/Bluetooth/system/rust/src/connection/ffi.rs:62:9
   |
62 | /         unsafe fn unchecked_register_rust_callbacks(
63 | |             self: Pin<&mut Self>,
64 | |             callbacks: Box<LeAclManagerCallbackShim>,
65 | |         );
   | |_________^
   |
   = help: for further information visit
https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
   = note: `-D clippy::missing-safety-doc` implied by `-D warnings`
   = help: to override `-D warnings` add
`#[allow(clippy::missing_safety_doc)]`

error: aborting due to 1 previous error
```

Bug: http://b/346588808
Test: ./toolchain/android_rust/tools/test_compiler.py --prebuilt-path dist/rust-linux.tar.xz --target aosp_cf_x86_64_phone --image --reuse-prebuilt

Bug: 346588808
Test: m aosp_cf_x86_64_phone
Change-Id: I015915f20cd97172bbc66913412da5f139a909de
parent f13fbb70
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -56,8 +56,10 @@ mod inner {
        /// Register Rust callbacks for connection events
        ///
        /// # Safety
        ///
        /// `callbacks` must be Send + Sync, since C++ moves it to a different thread and
        /// invokes it from several others (GD + legacy threads).
        #[allow(clippy::missing_safety_doc)]
        #[cxx_name = "RegisterRustCallbacks"]
        unsafe fn unchecked_register_rust_callbacks(
            self: Pin<&mut Self>,