|
302 | 302 | //!
|
303 | 303 | //! # `Missing` and relevant constructors
|
304 | 304 | //!
|
305 |
| -//! Take the following example: |
| 305 | +//! Take the following variation on the previous example: |
306 | 306 | //!
|
307 | 307 | //! ```compile_fail,E0004
|
308 | 308 | //! enum Direction { North, South, East, West }
|
|
313 | 313 | //! }
|
314 | 314 | //! ```
|
315 | 315 | //!
|
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 |
317 | 318 | //! specialize with `Missing` in the first column, we have one arm left:
|
318 | 319 | //!
|
319 | 320 | //! ```ignore(partial code)
|
|
332 | 333 | //!
|
333 | 334 | //! Because `Missing` only matches wildcard rows, specializing with `Missing` is guaranteed to
|
334 | 335 | //! 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. |
339 | 340 | //!
|
340 | 341 | //! When specializing, if there is a `Missing` case we call the other constructors "irrelevant".
|
341 | 342 | //! When there is no `Missing` case there are no irrelevant constructors.
|
|
0 commit comments