Fix clippy warnings. am: 81cefe2a6d am: 9163b396d3 am: 421422e15f
Original change: https://android-review.googlesource.com/c/platform/external/minijail/+/1675725
Change-Id: I0b5c337f601617e98a2320a25f4ca2cedaeded30
diff --git a/rust/minijail-sys/libminijail.rs b/rust/minijail-sys/libminijail.rs
index bf1e5ae..aa613cb 100644
--- a/rust/minijail-sys/libminijail.rs
+++ b/rust/minijail-sys/libminijail.rs
@@ -1,4 +1,5 @@
/* automatically generated by rust-bindgen */
+#![allow(clippy::all)]
pub type __rlim64_t = u64;
pub type __u8 = u8;
diff --git a/rust/minijail/src/lib.rs b/rust/minijail/src/lib.rs
index 03ef878..7805721 100644
--- a/rust/minijail/src/lib.rs
+++ b/rust/minijail/src/lib.rs
@@ -676,6 +676,8 @@
}
/// Forks a child and puts it in the previously configured minijail.
+ ///
+ /// # Safety
/// `fork` is unsafe because it closes all open FD for this process. That
/// could cause a lot of trouble if not handled carefully. FDs 0, 1, and 2
/// are overwritten with /dev/null FDs unless they are included in the
@@ -693,6 +695,9 @@
/// Behaves the same as `fork()` except `inheritable_fds` is a list of fd
/// mappings rather than just a list of fds to preserve.
+ ///
+ /// # Safety
+ /// See `fork`.
pub unsafe fn fork_remap(&self, inheritable_fds: &[(RawFd, RawFd)]) -> Result<pid_t> {
if !is_single_threaded().map_err(Error::CheckingMultiThreaded)? {
// This test will fail during `cargo test` because the test harness always spawns a test