Skip to content

Commit 6cf2d18

Browse files
authored
Rollup merge of #139157 - mejrs:never, r=Noratrieb
Remove mention of `exhaustive_patterns` from `never` docs The example shows an exhaustive match: ```rust #![feature(exhaustive_patterns)] use std::str::FromStr; let Ok(s) = String::from_str("hello"); ``` But #119612 moved this functionality to `#![feature(min_exhaustive_patterns)` and then stabilized it.
2 parents b17948a + 73d33ed commit 6cf2d18

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Diff for: library/core/src/primitive_docs.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,13 @@ mod prim_bool {}
127127
/// [`Result<String, !>`] which we can unpack like this:
128128
///
129129
/// ```
130-
/// #![feature(exhaustive_patterns)]
131130
/// use std::str::FromStr;
132131
/// let Ok(s) = String::from_str("hello");
133132
/// ```
134133
///
135-
/// Since the [`Err`] variant contains a `!`, it can never occur. If the `exhaustive_patterns`
136-
/// feature is present this means we can exhaustively match on [`Result<T, !>`] by just taking the
137-
/// [`Ok`] variant. This illustrates another behavior of `!` - it can be used to "delete" certain
138-
/// enum variants from generic types like `Result`.
134+
/// Since the [`Err`] variant contains a `!`, it can never occur. This means we can exhaustively
135+
/// match on [`Result<T, !>`] by just taking the [`Ok`] variant. This illustrates another behavior
136+
/// of `!` - it can be used to "delete" certain enum variants from generic types like `Result`.
139137
///
140138
/// ## Infinite loops
141139
///

0 commit comments

Comments
 (0)