Skip to content

Commit 0f94e99

Browse files
authored
Merge pull request #425 from Kriskras99/feat/doc_links
Add links to more items
2 parents f301423 + f1eb081 commit 0f94e99

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/lib.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@
3838
//! # Details
3939
//!
4040
//! - Thiserror deliberately does not appear in your public API. You get the
41-
//! same thing as if you had written an implementation of `std::error::Error`
41+
//! same thing as if you had written an implementation of [`std::error::Error`]
4242
//! by hand, and switching from handwritten impls to thiserror or vice versa
4343
//! is not a breaking change.
4444
//!
4545
//! - Errors may be enums, structs with named fields, tuple structs, or unit
4646
//! structs.
4747
//!
48-
//! - A `Display` impl is generated for your error if you provide
48+
//! - A [`Display`] impl is generated for your error if you provide
4949
//! `#[error("...")]` messages on the struct or each variant of your enum, as
5050
//! shown above in the example.
5151
//!
@@ -96,7 +96,7 @@
9696
//! }
9797
//! ```
9898
//!
99-
//! - A `From` impl is generated for each variant that contains a `#[from]`
99+
//! - A [`From`] impl is generated for each variant that contains a `#[from]`
100100
//! attribute.
101101
//!
102102
//! The variant using `#[from]` must not contain any other fields beyond the
@@ -128,7 +128,7 @@
128128
//! # }
129129
//! ```
130130
//!
131-
//! - The Error trait's `source()` method is implemented to return whichever
131+
//! - The Error trait's [`source()`] method is implemented to return whichever
132132
//! field has a `#[source]` attribute or is named `source`, if any. This is
133133
//! for identifying the underlying lower level error that caused your error.
134134
//!
@@ -156,9 +156,9 @@
156156
//! # }
157157
//! ```
158158
//!
159-
//! - The Error trait's `provide()` method is implemented to provide whichever
159+
//! - The Error trait's [`provide()`] method is implemented to provide whichever
160160
//! field has a type named `Backtrace`, if any, as a
161-
//! `std::backtrace::Backtrace`. Using `Backtrace` in errors requires a
161+
//! [`std::backtrace::Backtrace`]. Using `Backtrace` in errors requires a
162162
//! nightly compiler with Rust version 1.73 or newer.
163163
//!
164164
//! ```rust
@@ -175,7 +175,7 @@
175175
//!
176176
//! - If a field is both a source (named `source`, or has `#[source]` or
177177
//! `#[from]` attribute) *and* is marked `#[backtrace]`, then the Error
178-
//! trait's `provide()` method is forwarded to the source's `provide` so that
178+
//! trait's [`provide()`] method is forwarded to the source's `provide` so that
179179
//! both layers of the error share the same backtrace. The `#[backtrace]`
180180
//! attribute requires a nightly compiler with Rust version 1.73 or newer.
181181
//!
@@ -207,7 +207,7 @@
207207
//! # };
208208
//! ```
209209
//!
210-
//! - Errors may use `error(transparent)` to forward the source and Display
210+
//! - Errors may use `error(transparent)` to forward the source and [`Display`]
211211
//! methods straight through to an underlying error without adding an
212212
//! additional message. This would be appropriate for enums that need an
213213
//! "anything else" variant.
@@ -255,6 +255,9 @@
255255
//! in application code.
256256
//!
257257
//! [`anyhow`]: https://github.com/dtolnay/anyhow
258+
//! [`source()`]: std::error::Error::source
259+
//! [`provide()`]: std::error::Error::provide
260+
//! [`Display`]: std::fmt::Display
258261
259262
#![no_std]
260263
#![doc(html_root_url = "https://docs.rs/thiserror/2.0.12")]

0 commit comments

Comments
 (0)