diff options
| author | bors <bors@rust-lang.org> | 2021-01-03 12:21:12 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-01-03 12:21:12 +0000 |
| commit | bcd69750794b315d7c673351f86cacdf5232a0b7 (patch) | |
| tree | 91bfa1aef0932e120f1ce6cee5f52c81b4a959e3 /library/std/src | |
| parent | 18cb4ad3b9440b3ff2ed16976f56889b23811e13 (diff) | |
| parent | 4e767596e2988106c970a08ba1c0bcf16e340fc4 (diff) | |
| download | rust-bcd69750794b315d7c673351f86cacdf5232a0b7.tar.gz rust-bcd69750794b315d7c673351f86cacdf5232a0b7.zip | |
Auto merge of #80590 - camelid:bool-never-docs, r=nagisa
Update `bool` and `!` docs
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/primitive_docs.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/library/std/src/primitive_docs.rs b/library/std/src/primitive_docs.rs index 0677a5f6715..876b2b8a3f6 100644 --- a/library/std/src/primitive_docs.rs +++ b/library/std/src/primitive_docs.rs @@ -11,8 +11,9 @@ /// `bool` implements various traits, such as [`BitAnd`], [`BitOr`], [`Not`], etc., /// which allow us to perform boolean operations using `&`, `|` and `!`. /// -/// `if` always demands a `bool` value. [`assert!`], which is an important macro in testing, -/// checks whether an expression returns `true` and panics if it isn't. +/// `if` requires a `bool` value as its conditional. [`assert!`], which is an +/// important macro in testing, checks whether an expression is `true` and panics +/// if it isn't. /// /// ``` /// let bool_val = true & false | false; @@ -25,7 +26,7 @@ /// /// # Examples /// -/// A trivial example of the usage of `bool`, +/// A trivial example of the usage of `bool`: /// /// ``` /// let praise_the_borrow_checker = true; @@ -122,9 +123,9 @@ mod prim_bool {} /// `!`, if we have to call [`String::from_str`] for some reason the result will be a /// [`Result<String, !>`] which we can unpack like this: /// -/// ```ignore (string-from-str-error-type-is-not-never-yet) -/// #[feature(exhaustive_patterns)] -/// // NOTE: this does not work today! +/// ``` +/// #![feature(exhaustive_patterns)] +/// use std::str::FromStr; /// let Ok(s) = String::from_str("hello"); /// ``` /// |
