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 {}
130130/// [`Result<String, !>`] which we can unpack like this:
131131///
132132/// ```
133- /// #![feature(exhaustive_patterns)]
134133/// use std::str::FromStr;
135134/// let Ok(s) = String::from_str("hello");
136135/// ```
137136///
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`.
142140///
143141/// ## Infinite loops
144142///
Original file line number Diff line number Diff line change @@ -130,15 +130,13 @@ mod prim_bool {}
130130/// [`Result<String, !>`] which we can unpack like this:
131131///
132132/// ```
133- /// #![feature(exhaustive_patterns)]
134133/// use std::str::FromStr;
135134/// let Ok(s) = String::from_str("hello");
136135/// ```
137136///
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`.
142140///
143141/// ## Infinite loops
144142///
Original file line number Diff line number Diff line change @@ -29,9 +29,6 @@ pub struct IndirectUninhabitedVariants(UninhabitedVariants);
2929
3030struct A ;
3131
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-
3532fn cannot_empty_match_on_empty_enum_to_anything ( x : IndirectUninhabitedEnum ) -> A {
3633 match x { }
3734}
You can’t perform that action at this time.
0 commit comments