Skip to content

Commit 1283043

Browse files
added link references to objects in documentation
1 parent 2b5a2a6 commit 1283043

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

alloc-fmt/src/lib.rs

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@
77

88
//! Allocator-safe formatting and assertion macros.
99
//!
10-
//! `alloc-fmt` provides formatting and assertion macros similar to the standard library's
10+
//! [`alloc-fmt`] provides formatting and assertion macros similar to the standard library's
1111
//! [`println`], [`eprintln`], [`panic`], [`assert`], [`debug_assert`], etc which are safe for use in a
1212
//! global allocator. The standard library's formatting and assertion macros can allocate, meaning
1313
//! that if they are used in the implementation of a global allocator, it can cause infinite
1414
//! recursion. The macros in this crate avoid this problem by either not allocating (in the case of
1515
//! formatting macros) or detecting recursion (in the case of panic and assertion macros).
1616
//!
17-
//! [`println`]: ../std/macro.println.html
18-
//! [`eprintln`]: ../std/macro.eprint.html
19-
//! [`panic`]: ../std/macro.panic.html
20-
//! [`assert`]: ../std/macro.assert.html
21-
//! [`debug_assert`]: ../std/macro.debug_assert.html
17+
//! [`alloc-fmt`]: index.html
18+
//! [`println`]: https://doc.rust-lang.org/std/macro.println.html
19+
//! [`eprintln`]: https://doc.rust-lang.org/std/macro.eprint.html
20+
//! [`panic`]: https://doc.rust-lang.org/std/macro.panic.html
21+
//! [`assert`]: https://doc.rust-lang.org/std/macro.assert.html
22+
//! [`debug_assert`]: https://doc.rust-lang.org/std/macro.debug_assert.html
2223
//!
2324
//! # Usage and Behavior
2425
//! The macros in this crate are named `alloc_xxx`, where `xxx` is the name of the equivalent
@@ -36,8 +37,8 @@
3637
//! Unlike the standard library assertion and panic macros, the stack is not unwound, and once an
3738
//! assertion failure or panic triggers, it cannot be caught or aborted.
3839
//!
39-
//! [`alloc_println`]: /macro.alloc_println.html
40-
//! [`alloc_debug_assert`]: /macro.alloc_debug_assert.html
40+
//! [`alloc_println`]: macro.alloc_println.html
41+
//! [`alloc_debug_assert`]: macro.alloc_debug_assert.html
4142
4243
#![no_std]
4344
#![feature(core_intrinsics)]
@@ -286,9 +287,13 @@ macro_rules! alloc_debug_assert_ne {
286287

287288
/// Types that can be unwrapped in an allocation-safe manner.
288289
///
289-
/// `AllocUnwrap` provides the `alloc_unwrap` and `alloc_expect` methods, which are allocation-safe
290-
/// equivalents of the `unwrap` and `expect` methods on `Option` and `Result`. `AllocUnwrap` is
291-
/// implemented for `Option` and `Result`.
290+
/// [`AllocUnwrap`] provides the [`alloc_unwrap`] and [`alloc_expect`] methods, which are allocation-safe
291+
/// equivalents of the [`unwrap`][Option::unwrap] and [`expect`][Option::expect] methods on [`Option`] and [`Result`]. [`AllocUnwrap`] is
292+
/// implemented for [`Option`] and [`Result`].
293+
///
294+
/// [`AllocUnwrap`]: trait.AllocUnwrap.html
295+
/// [`alloc_unwrap`]: trait.AllocUnwrap.html#tymethod.alloc_unwrap
296+
/// [`alloc_expect`]: trait.AllocUnwrap.html#tymethod.alloc_expect
292297
///
293298
/// # Examples
294299
///

0 commit comments

Comments
 (0)