Skip to content

Commit

Permalink
tmp: start addressing reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril committed Dec 20, 2023
1 parent 3130650 commit 600f3ff
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions compiler/rustc_pattern_analysis/src/usefulness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
//!
//! # `Missing` and relevant constructors
//!
//! Take the following example:
//! Take the following variation on the previous example:
//!
//! ```compile_fail,E0004
//! enum Direction { North, South, East, West }
Expand All @@ -313,7 +313,8 @@
//! }
//! ```
//!
//! Remember that we represent the "everything else" cases with [`Constructor::Missing`]. When we
//! As explained in [`crate::constructor`], we represent the "everything else" cases with
//! [`Constructor::Missing`]. This constructor is only covered by wildcards in the column. When we
//! specialize with `Missing` in the first column, we have one arm left:
//!
//! ```ignore(partial code)
Expand All @@ -332,10 +333,10 @@
//!
//! Because `Missing` only matches wildcard rows, specializing with `Missing` is guaranteed to
//! result in a subset of the rows obtained from specializing with anything else. This means that
//! any row with a wildcard found useful when specializing with anything else would also be found
//! useful in the `Missing` case. In our example, after specializing with `North` here we will not
//! gain new information regarding the usefulness of arm 2 or of the fake wildcard row used for
//! exhaustiveness. This allows us to skip cases.
//! any row with a wildcard found useful when specializing with any non-`Missing` constructor would
//! also be found useful in the `Missing` case. In our example, after specializing with `North` here
//! we will not gain new information regarding the usefulness of arm 2 or of the fake wildcard row
//! used for exhaustiveness. This allows us to skip cases.
//!
//! When specializing, if there is a `Missing` case we call the other constructors "irrelevant".
//! When there is no `Missing` case there are no irrelevant constructors.
Expand Down

0 comments on commit 600f3ff

Please sign in to comment.