1
Fork 0

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 @@ impl<T> Option<T> {
/// ///
/// # Safety /// # 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 /// # Examples
/// ///

View file

@ -827,7 +827,9 @@ impl<T, E> Result<T, E> {
/// ///
/// # Safety /// # 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 /// # Examples
/// ///
@ -859,7 +861,9 @@ impl<T, E> Result<T, E> {
/// ///
/// # Safety /// # 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 /// # Examples
/// ///