diff --git a/src/allocation.rs b/src/allocation.rs index 83f11b8..bdcf724 100644 --- a/src/allocation.rs +++ b/src/allocation.rs @@ -19,16 +19,18 @@ use alloc::{ vec, vec::Vec, }; -use core::mem::ManuallyDrop; -use core::ops::{Deref, DerefMut}; +use core::{ + mem::ManuallyDrop, + ops::{Deref, DerefMut}, +}; -/// As [`try_cast_box`](try_cast_box), but unwraps for you. +/// As [`try_cast_box`], but unwraps for you. #[inline] pub fn cast_box(input: Box) -> Box { try_cast_box(input).map_err(|(e, _v)| e).unwrap() } -/// Attempts to cast the content type of a [`Box`](alloc::boxed::Box). +/// Attempts to cast the content type of a [`Box`]. /// /// On failure you get back an error along with the starting `Box`. /// @@ -139,12 +141,12 @@ pub fn try_zeroed_slice_box( } } -/// As [`try_zeroed_slice_box`](try_zeroed_slice_box), but unwraps for you. +/// As [`try_zeroed_slice_box`], but unwraps for you. pub fn zeroed_slice_box(length: usize) -> Box<[T]> { try_zeroed_slice_box(length).unwrap() } -/// As [`try_cast_slice_box`](try_cast_slice_box), but unwraps for you. +/// As [`try_cast_slice_box`], but unwraps for you. #[inline] pub fn cast_slice_box( input: Box<[A]>, @@ -195,13 +197,13 @@ pub fn try_cast_slice_box( } } -/// As [`try_cast_vec`](try_cast_vec), but unwraps for you. +/// As [`try_cast_vec`], but unwraps for you. #[inline] pub fn cast_vec(input: Vec) -> Vec { try_cast_vec(input).map_err(|(e, _v)| e).unwrap() } -/// Attempts to cast the content type of a [`Vec`](alloc::vec::Vec). +/// Attempts to cast the content type of a [`Vec`]. /// /// On failure you get back an error along with the starting `Vec`. /// @@ -300,7 +302,7 @@ pub fn pod_collect_to_vec( dst } -/// As [`try_cast_rc`](try_cast_rc), but unwraps for you. +/// As [`try_cast_rc`], but unwraps for you. #[inline] pub fn cast_rc( input: Rc, @@ -308,7 +310,7 @@ pub fn cast_rc( try_cast_rc(input).map_err(|(e, _v)| e).unwrap() } -/// Attempts to cast the content type of a [`Rc`](alloc::rc::Rc). +/// Attempts to cast the content type of a [`Rc`]. /// /// On failure you get back an error along with the starting `Rc`. /// @@ -336,7 +338,7 @@ pub fn try_cast_rc( } } -/// As [`try_cast_arc`](try_cast_arc), but unwraps for you. +/// As [`try_cast_arc`], but unwraps for you. #[inline] #[cfg(target_has_atomic = "ptr")] pub fn cast_arc( @@ -345,7 +347,7 @@ pub fn cast_arc( try_cast_arc(input).map_err(|(e, _v)| e).unwrap() } -/// Attempts to cast the content type of a [`Arc`](alloc::sync::Arc). +/// Attempts to cast the content type of a [`Arc`]. /// /// On failure you get back an error along with the starting `Arc`. /// @@ -377,7 +379,7 @@ pub fn try_cast_arc< } } -/// As [`try_cast_slice_rc`](try_cast_slice_rc), but unwraps for you. +/// As [`try_cast_slice_rc`], but unwraps for you. #[inline] pub fn cast_slice_rc< A: NoUninit + AnyBitPattern, @@ -439,7 +441,7 @@ pub fn try_cast_slice_rc< } } -/// As [`try_cast_slice_arc`](try_cast_slice_arc), but unwraps for you. +/// As [`try_cast_slice_arc`], but unwraps for you. #[inline] #[cfg(target_has_atomic = "ptr")] pub fn cast_slice_arc< @@ -557,8 +559,7 @@ pub trait TransparentWrapperAlloc: } } - /// Convert an [`Rc`](alloc::rc::Rc) to the inner type into an `Rc` to the - /// wrapper type. + /// Convert an [`Rc`] to the inner type into an `Rc` to the wrapper type. #[inline] fn wrap_rc(s: Rc) -> Rc { // The unsafe contract requires that these two have @@ -584,8 +585,7 @@ pub trait TransparentWrapperAlloc: } } - /// Convert an [`Arc`](alloc::sync::Arc) to the inner type into an `Arc` to - /// the wrapper type. + /// Convert an [`Arc`] to the inner type into an `Arc` to the wrapper type. #[inline] #[cfg(target_has_atomic = "ptr")] fn wrap_arc(s: Arc) -> Arc { @@ -662,8 +662,7 @@ pub trait TransparentWrapperAlloc: } } - /// Convert an [`Rc`](alloc::rc::Rc) to the wrapper type into an `Rc` to the - /// inner type. + /// Convert an [`Rc`] to the wrapper type into an `Rc` to the inner type. #[inline] fn peel_rc(s: Rc) -> Rc { // The unsafe contract requires that these two have @@ -689,8 +688,7 @@ pub trait TransparentWrapperAlloc: } } - /// Convert an [`Arc`](alloc::sync::Arc) to the wrapper type into an `Arc` to - /// the inner type. + /// Convert an [`Arc`] to the wrapper type into an `Arc` to the inner type. #[inline] #[cfg(target_has_atomic = "ptr")] fn peel_arc(s: Arc) -> Arc { diff --git a/src/lib.rs b/src/lib.rs index 07995c1..b3e3e1a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,6 @@ #![no_std] #![warn(missing_docs)] +#![allow(unexpected_cfgs)] #![allow(clippy::match_like_matches_macro)] #![allow(clippy::uninlined_format_args)] #![cfg_attr(feature = "nightly_docs", feature(doc_cfg))] @@ -83,7 +84,7 @@ //! instead of just for a select list of array lengths. //! * `must_cast`: Provides the `must_` functions, which will compile error if //! the requested cast can't be statically verified. -//! * `const_zeroed`: Provides the const [`zeroed`] function. +//! * `const_zeroed`: Provides a const version of the `zeroed` function. #[cfg(all(target_arch = "aarch64", feature = "aarch64_simd"))] use core::arch::aarch64;