add extra lints to align with Chromium rust toolchain

Change-Id: Ib3372c2a4e0e6189402485e87963d8151ad29981
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/58786
Reviewed-by: Adam Langley <agl@google.com>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Bob Beck <bbe@google.com>
This commit is contained in:
Nabil Wadih
2023-04-17 17:53:09 +00:00
committed by Boringssl LUCI CQ
parent 404d98b6f7
commit fa7afff95a
+3 -2
View File
@@ -15,6 +15,7 @@
#![deny(
missing_docs,
unsafe_op_in_unsafe_fn,
clippy::indexing_slicing,
clippy::unwrap_used,
clippy::panic,
@@ -107,7 +108,7 @@ unsafe trait ForeignTypeRef: Sized {
#[inline]
unsafe fn from_ptr<'a>(ptr: *mut Self::CType) -> &'a Self {
debug_assert!(!ptr.is_null());
&*(ptr as *mut _)
unsafe { &*(ptr as *mut _) }
}
/// Constructs a mutable reference of this type from its raw type.
@@ -118,7 +119,7 @@ unsafe trait ForeignTypeRef: Sized {
#[inline]
unsafe fn from_ptr_mut<'a>(ptr: *mut Self::CType) -> &'a mut Self {
debug_assert!(!ptr.is_null());
&mut *(ptr as *mut _)
unsafe { &mut *(ptr as *mut _) }
}
/// Returns a raw pointer to the wrapped value.