Skip to content

Commit 600f3ff

Browse files
committed
tmp: start addressing reviews
1 parent 3130650 commit 600f3ff

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

compiler/rustc_pattern_analysis/src/usefulness.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@
302302
//!
303303
//! # `Missing` and relevant constructors
304304
//!
305-
//! Take the following example:
305+
//! Take the following variation on the previous example:
306306
//!
307307
//! ```compile_fail,E0004
308308
//! enum Direction { North, South, East, West }
@@ -313,7 +313,8 @@
313313
//! }
314314
//! ```
315315
//!
316-
//! Remember that we represent the "everything else" cases with [`Constructor::Missing`]. When we
316+
//! As explained in [`crate::constructor`], we represent the "everything else" cases with
317+
//! [`Constructor::Missing`]. This constructor is only covered by wildcards in the column. When we
317318
//! specialize with `Missing` in the first column, we have one arm left:
318319
//!
319320
//! ```ignore(partial code)
@@ -332,10 +333,10 @@
332333
//!
333334
//! Because `Missing` only matches wildcard rows, specializing with `Missing` is guaranteed to
334335
//! result in a subset of the rows obtained from specializing with anything else. This means that
335-
//! any row with a wildcard found useful when specializing with anything else would also be found
336-
//! useful in the `Missing` case. In our example, after specializing with `North` here we will not
337-
//! gain new information regarding the usefulness of arm 2 or of the fake wildcard row used for
338-
//! exhaustiveness. This allows us to skip cases.
336+
//! any row with a wildcard found useful when specializing with any non-`Missing` constructor would
337+
//! also be found useful in the `Missing` case. In our example, after specializing with `North` here
338+
//! we will not gain new information regarding the usefulness of arm 2 or of the fake wildcard row
339+
//! used for exhaustiveness. This allows us to skip cases.
339340
//!
340341
//! When specializing, if there is a `Missing` case we call the other constructors "irrelevant".
341342
//! When there is no `Missing` case there are no irrelevant constructors.

0 commit comments

Comments
 (0)