Skip to content

Commit b39b681

Browse files
committed
fix up docs warnings
1 parent 99e9508 commit b39b681

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

src/allocation.rs

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,18 @@ use alloc::{
1919
vec,
2020
vec::Vec,
2121
};
22-
use core::mem::ManuallyDrop;
23-
use core::ops::{Deref, DerefMut};
22+
use core::{
23+
mem::ManuallyDrop,
24+
ops::{Deref, DerefMut},
25+
};
2426

25-
/// As [`try_cast_box`](try_cast_box), but unwraps for you.
27+
/// As [`try_cast_box`], but unwraps for you.
2628
#[inline]
2729
pub fn cast_box<A: NoUninit, B: AnyBitPattern>(input: Box<A>) -> Box<B> {
2830
try_cast_box(input).map_err(|(e, _v)| e).unwrap()
2931
}
3032

31-
/// Attempts to cast the content type of a [`Box`](alloc::boxed::Box).
33+
/// Attempts to cast the content type of a [`Box`].
3234
///
3335
/// On failure you get back an error along with the starting `Box`.
3436
///
@@ -139,12 +141,12 @@ pub fn try_zeroed_slice_box<T: Zeroable>(
139141
}
140142
}
141143

142-
/// As [`try_zeroed_slice_box`](try_zeroed_slice_box), but unwraps for you.
144+
/// As [`try_zeroed_slice_box`], but unwraps for you.
143145
pub fn zeroed_slice_box<T: Zeroable>(length: usize) -> Box<[T]> {
144146
try_zeroed_slice_box(length).unwrap()
145147
}
146148

147-
/// As [`try_cast_slice_box`](try_cast_slice_box), but unwraps for you.
149+
/// As [`try_cast_slice_box`], but unwraps for you.
148150
#[inline]
149151
pub fn cast_slice_box<A: NoUninit, B: AnyBitPattern>(
150152
input: Box<[A]>,
@@ -195,13 +197,13 @@ pub fn try_cast_slice_box<A: NoUninit, B: AnyBitPattern>(
195197
}
196198
}
197199

198-
/// As [`try_cast_vec`](try_cast_vec), but unwraps for you.
200+
/// As [`try_cast_vec`], but unwraps for you.
199201
#[inline]
200202
pub fn cast_vec<A: NoUninit, B: AnyBitPattern>(input: Vec<A>) -> Vec<B> {
201203
try_cast_vec(input).map_err(|(e, _v)| e).unwrap()
202204
}
203205

204-
/// Attempts to cast the content type of a [`Vec`](alloc::vec::Vec).
206+
/// Attempts to cast the content type of a [`Vec`].
205207
///
206208
/// On failure you get back an error along with the starting `Vec`.
207209
///
@@ -300,15 +302,15 @@ pub fn pod_collect_to_vec<A: NoUninit, B: NoUninit + AnyBitPattern>(
300302
dst
301303
}
302304

303-
/// As [`try_cast_rc`](try_cast_rc), but unwraps for you.
305+
/// As [`try_cast_rc`], but unwraps for you.
304306
#[inline]
305307
pub fn cast_rc<A: NoUninit + AnyBitPattern, B: NoUninit + AnyBitPattern>(
306308
input: Rc<A>,
307309
) -> Rc<B> {
308310
try_cast_rc(input).map_err(|(e, _v)| e).unwrap()
309311
}
310312

311-
/// Attempts to cast the content type of a [`Rc`](alloc::rc::Rc).
313+
/// Attempts to cast the content type of a [`Rc`].
312314
///
313315
/// On failure you get back an error along with the starting `Rc`.
314316
///
@@ -336,7 +338,7 @@ pub fn try_cast_rc<A: NoUninit + AnyBitPattern, B: NoUninit + AnyBitPattern>(
336338
}
337339
}
338340

339-
/// As [`try_cast_arc`](try_cast_arc), but unwraps for you.
341+
/// As [`try_cast_arc`], but unwraps for you.
340342
#[inline]
341343
#[cfg(target_has_atomic = "ptr")]
342344
pub fn cast_arc<A: NoUninit + AnyBitPattern, B: NoUninit + AnyBitPattern>(
@@ -345,7 +347,7 @@ pub fn cast_arc<A: NoUninit + AnyBitPattern, B: NoUninit + AnyBitPattern>(
345347
try_cast_arc(input).map_err(|(e, _v)| e).unwrap()
346348
}
347349

348-
/// Attempts to cast the content type of a [`Arc`](alloc::sync::Arc).
350+
/// Attempts to cast the content type of a [`Arc`].
349351
///
350352
/// On failure you get back an error along with the starting `Arc`.
351353
///
@@ -377,7 +379,7 @@ pub fn try_cast_arc<
377379
}
378380
}
379381

380-
/// As [`try_cast_slice_rc`](try_cast_slice_rc), but unwraps for you.
382+
/// As [`try_cast_slice_rc`], but unwraps for you.
381383
#[inline]
382384
pub fn cast_slice_rc<
383385
A: NoUninit + AnyBitPattern,
@@ -439,7 +441,7 @@ pub fn try_cast_slice_rc<
439441
}
440442
}
441443

442-
/// As [`try_cast_slice_arc`](try_cast_slice_arc), but unwraps for you.
444+
/// As [`try_cast_slice_arc`], but unwraps for you.
443445
#[inline]
444446
#[cfg(target_has_atomic = "ptr")]
445447
pub fn cast_slice_arc<
@@ -557,8 +559,7 @@ pub trait TransparentWrapperAlloc<Inner: ?Sized>:
557559
}
558560
}
559561

560-
/// Convert an [`Rc`](alloc::rc::Rc) to the inner type into an `Rc` to the
561-
/// wrapper type.
562+
/// Convert an [`Rc`] to the inner type into an `Rc` to the wrapper type.
562563
#[inline]
563564
fn wrap_rc(s: Rc<Inner>) -> Rc<Self> {
564565
// The unsafe contract requires that these two have
@@ -584,8 +585,7 @@ pub trait TransparentWrapperAlloc<Inner: ?Sized>:
584585
}
585586
}
586587

587-
/// Convert an [`Arc`](alloc::sync::Arc) to the inner type into an `Arc` to
588-
/// the wrapper type.
588+
/// Convert an [`Arc`] to the inner type into an `Arc` to the wrapper type.
589589
#[inline]
590590
#[cfg(target_has_atomic = "ptr")]
591591
fn wrap_arc(s: Arc<Inner>) -> Arc<Self> {
@@ -662,8 +662,7 @@ pub trait TransparentWrapperAlloc<Inner: ?Sized>:
662662
}
663663
}
664664

665-
/// Convert an [`Rc`](alloc::rc::Rc) to the wrapper type into an `Rc` to the
666-
/// inner type.
665+
/// Convert an [`Rc`] to the wrapper type into an `Rc` to the inner type.
667666
#[inline]
668667
fn peel_rc(s: Rc<Self>) -> Rc<Inner> {
669668
// The unsafe contract requires that these two have
@@ -689,8 +688,7 @@ pub trait TransparentWrapperAlloc<Inner: ?Sized>:
689688
}
690689
}
691690

692-
/// Convert an [`Arc`](alloc::sync::Arc) to the wrapper type into an `Arc` to
693-
/// the inner type.
691+
/// Convert an [`Arc`] to the wrapper type into an `Arc` to the inner type.
694692
#[inline]
695693
#[cfg(target_has_atomic = "ptr")]
696694
fn peel_arc(s: Arc<Self>) -> Arc<Inner> {

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![no_std]
22
#![warn(missing_docs)]
3+
#![allow(unexpected_cfgs)]
34
#![allow(clippy::match_like_matches_macro)]
45
#![allow(clippy::uninlined_format_args)]
56
#![cfg_attr(feature = "nightly_docs", feature(doc_cfg))]
@@ -83,7 +84,7 @@
8384
//! instead of just for a select list of array lengths.
8485
//! * `must_cast`: Provides the `must_` functions, which will compile error if
8586
//! the requested cast can't be statically verified.
86-
//! * `const_zeroed`: Provides the const [`zeroed`] function.
87+
//! * `const_zeroed`: Provides a const version of the `zeroed` function.
8788
8889
#[cfg(all(target_arch = "aarch64", feature = "aarch64_simd"))]
8990
use core::arch::aarch64;

0 commit comments

Comments
 (0)