Link the reference about undefined behavior

Suggested-by: Mara Bos <m-ou.se@m-ou.se>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This commit is contained in:
Miguel Ojeda 2021-01-25 14:53:19 +01:00
parent 76299b3f42
commit 0140dacabb
2 changed files with 9 additions and 3 deletions

View File

@ -433,7 +433,9 @@ pub fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
///
/// # Safety
///
/// Undefined behavior if the value is [`None`].
/// Calling this method on [`None`] is *[undefined behavior]*.
///
/// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
///
/// # Examples
///

View File

@ -827,7 +827,9 @@ pub fn unwrap_or_else<F: FnOnce(E) -> T>(self, op: F) -> T {
///
/// # Safety
///
/// Undefined behavior if the value is an [`Err`].
/// Calling this method on an [`Err`] is *[undefined behavior]*.
///
/// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
///
/// # Examples
///
@ -859,7 +861,9 @@ pub unsafe fn unwrap_unchecked(self) -> T {
///
/// # Safety
///
/// Undefined behavior if the value is an [`Ok`].
/// Calling this method on an [`Ok`] is *[undefined behavior]*.
///
/// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
///
/// # Examples
///