diff --git a/src/allocation.rs b/src/allocation.rs index bdcf724..1763ffd 100644 --- a/src/allocation.rs +++ b/src/allocation.rs @@ -1,4 +1,5 @@ #![cfg(feature = "extern_crate_alloc")] +#![allow(clippy::duplicated_attributes)] //! Stuff to boost things in the `alloc` crate. //! diff --git a/src/anybitpattern.rs b/src/anybitpattern.rs index 56c6bc6..3b98b09 100644 --- a/src/anybitpattern.rs +++ b/src/anybitpattern.rs @@ -2,12 +2,12 @@ use crate::{Pod, Zeroable}; /// Marker trait for "plain old data" types that are valid for any bit pattern. /// -/// The requirements for this is very similar to [`Pod`], -/// except that the type can allow uninit (or padding) bytes. -/// This limits what you can do with a type of this kind, but also broadens the -/// included types to `repr(C)` `struct`s that contain padding as well as -/// `union`s. Notably, you can only cast *immutable* references and *owned* -/// values into [`AnyBitPattern`] types, not *mutable* references. +/// The requirements for this is very similar to [`Pod`], except that the type +/// can allow uninit (or padding) bytes. This limits what you can do with a type +/// of this kind, but also broadens the included types to `repr(C)` `struct`s +/// that contain padding as well as `union`s. Notably, you can only cast +/// *immutable* references and *owned* values into [`AnyBitPattern`] types, not +/// *mutable* references. /// /// [`Pod`] is a subset of [`AnyBitPattern`], meaning that any `T: Pod` is also /// [`AnyBitPattern`] but any `T: AnyBitPattern` is not necessarily [`Pod`]. @@ -26,8 +26,8 @@ use crate::{Pod, Zeroable}; /// below safety rules. /// /// * *NOTE: even `C-style`, fieldless enums are intentionally **excluded** from -/// this trait, since it is **unsound** for an enum to have a discriminant value -/// that is not one of its defined variants. +/// this trait, since it is **unsound** for an enum to have a discriminant +/// value that is not one of its defined variants. /// /// # Safety /// @@ -56,6 +56,9 @@ pub unsafe trait AnyBitPattern: unsafe impl AnyBitPattern for T {} #[cfg(feature = "zeroable_maybe_uninit")] -#[cfg_attr(feature = "nightly_docs", doc(cfg(feature = "zeroable_maybe_uninit")))] +#[cfg_attr( + feature = "nightly_docs", + doc(cfg(feature = "zeroable_maybe_uninit")) +)] unsafe impl AnyBitPattern for core::mem::MaybeUninit where T: AnyBitPattern {} diff --git a/src/checked.rs b/src/checked.rs index 9f55a6b..cb8c4c3 100644 --- a/src/checked.rs +++ b/src/checked.rs @@ -163,6 +163,7 @@ unsafe impl CheckedBitPattern for bool { #[inline] fn is_valid_bit_pattern(bits: &Self::Bits) -> bool { + // DO NOT use the `matches!` macro, it isn't 1.34 compatible. match *bits { 0 | 1 => true, _ => false, diff --git a/src/lib.rs b/src/lib.rs index 3966627..daa8177 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,6 +2,8 @@ #![warn(missing_docs)] #![allow(clippy::match_like_matches_macro)] #![allow(clippy::uninlined_format_args)] +#![allow(clippy::result_unit_err)] +#![allow(clippy::type_complexity)] #![cfg_attr(feature = "nightly_docs", feature(doc_cfg))] #![cfg_attr(feature = "nightly_portable_simd", feature(portable_simd))] #![cfg_attr(