File tree Expand file tree Collapse file tree 3 files changed +6
-13
lines changed
tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited Expand file tree Collapse file tree 3 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -130,15 +130,13 @@ mod prim_bool {}
130
130
/// [`Result<String, !>`] which we can unpack like this:
131
131
///
132
132
/// ```
133
- /// #![feature(exhaustive_patterns)]
134
133
/// use std::str::FromStr;
135
134
/// let Ok(s) = String::from_str("hello");
136
135
/// ```
137
136
///
138
- /// Since the [`Err`] variant contains a `!`, it can never occur. If the `exhaustive_patterns`
139
- /// feature is present this means we can exhaustively match on [`Result<T, !>`] by just taking the
140
- /// [`Ok`] variant. This illustrates another behaviour of `!` - it can be used to "delete" certain
141
- /// enum variants from generic types like `Result`.
137
+ /// Since the [`Err`] variant contains a `!`, it can never occur. This means we can exhaustively
138
+ /// match on [`Result<T, !>`] by just taking the [`Ok`] variant. This illustrates another behaviour
139
+ /// of `!` - it can be used to "delete" certain enum variants from generic types like `Result`.
142
140
///
143
141
/// ## Infinite loops
144
142
///
Original file line number Diff line number Diff line change @@ -130,15 +130,13 @@ mod prim_bool {}
130
130
/// [`Result<String, !>`] which we can unpack like this:
131
131
///
132
132
/// ```
133
- /// #![feature(exhaustive_patterns)]
134
133
/// use std::str::FromStr;
135
134
/// let Ok(s) = String::from_str("hello");
136
135
/// ```
137
136
///
138
- /// Since the [`Err`] variant contains a `!`, it can never occur. If the `exhaustive_patterns`
139
- /// feature is present this means we can exhaustively match on [`Result<T, !>`] by just taking the
140
- /// [`Ok`] variant. This illustrates another behaviour of `!` - it can be used to "delete" certain
141
- /// enum variants from generic types like `Result`.
137
+ /// Since the [`Err`] variant contains a `!`, it can never occur. This means we can exhaustively
138
+ /// match on [`Result<T, !>`] by just taking the [`Ok`] variant. This illustrates another behaviour
139
+ /// of `!` - it can be used to "delete" certain enum variants from generic types like `Result`.
142
140
///
143
141
/// ## Infinite loops
144
142
///
Original file line number Diff line number Diff line change @@ -29,9 +29,6 @@ pub struct IndirectUninhabitedVariants(UninhabitedVariants);
29
29
30
30
struct A ;
31
31
32
- // This test checks that an empty match on a non-exhaustive uninhabited type through a level of
33
- // indirection from the defining crate will not compile without `#![feature(exhaustive_patterns)]`.
34
-
35
32
fn cannot_empty_match_on_empty_enum_to_anything ( x : IndirectUninhabitedEnum ) -> A {
36
33
match x { }
37
34
}
You can’t perform that action at this time.
0 commit comments